前几天我遇到了HD硬件故障,并且一直试图重新创建我的Android编程环境.
我已经安装了Eclipse和Android SDK.我已将SDK更新到最新版本.
然后我从备份文件夹导入了我的项目.当我在eclipse中查看我的布局文件时,我无法查看Grphical.layout,因为它不是一个选项.我得到页面的以下选项卡选项(设计或源).
然而,我在虚拟机中拥有副本的旧环境为我提供了以下布局文件的选项卡选项(Graphical Layout或filename.xml)
任何想法为什么会发生这种情况?我认为它必须与eclipse有关,没有意识到它的menat正在看android xml布局文件.
请帮忙,
伊恩
我的应用程序实现了自动升级功能,因为该应用程序不会向市场发布.apk文件托管在网络服务器上.我已经实现了以下链接的第一部分
现在,当我运行应用程序时,会发生以下情况.
如果有新版本可用,则应用程序会提示用户是否要升级.
如果用户选择"是",则应用程序从服务器下载文件.
没有提供关于为何发生这种情况的日志文件信息.请有人帮我理解可能导致此问题的原因.这是生成fianl 2屏幕而不是我的代码的默认android代码.
在异步任务上运行以下代码后会发生这种情况:
protected void onPostExecute(String result) {
super.onPostExecute(result);
// dismiss the progress dialog
mProgressDialog.dismiss();
// get the file
String path = getFilesDir().getAbsolutePath()+ File.separator + getString(R.string.apk_file);
File file = new File(path);
// if it exists
if(file.exists()) {
// create and start the intent with the new file
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
startActivity(intent);
} else {
// display error message
Toast.makeText(context, "File was not downloaded", Toast.LENGTH_LONG).show();
}
}
Run Code Online (Sandbox Code Playgroud)
如果我卸载应用程序并使用浏览器转到文件位置,应用程序会自动下载,然后我可以从下载文件夹中成功安装它.
这可能是应用程序当前正在运行时应用程序正在尝试安装自己的问题吗?在升级过程中文件被下载到内部存储器而不是SD卡位置,因为我不能保证用户设备将存在SD卡.
我有一个显示客户信息的活动.所有控件都是动态绘制的,因为屏幕设计由中央SQL数据库控制.(IE屏幕位置,可编辑和强制)因此设计没有XML.
到目前为止,我所做的一切都非常有效,直到我尝试添加ListView对象来列出客户通信数据.(IE电话号码,电子邮件,传真号码或网站URL列表)
正确添加此列表视图并显示第一行数据,但我似乎无法再显示任何行.
这些项目将添加到表格行中,然后将这些项目添加到表格布局中.这可能是问题吗?但是,当添加ListView项时,首先将它添加到RelativeLayout项,这样这应该允许显示多行?!
任何想法为什么会发生这种情况?我检查了我的数组的值,我肯定有多个项目.
以下是Activities onCreate方法:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
model = SharedModel.getInstance();
dbHelper = new DatabaseHelper(this);
LinearLayout baseLayout = new LinearLayout(this);
baseLayout.setOrientation(LinearLayout.VERTICAL);
// add the customer name and number field.
// NOTE: We will always require this widget regardless of dialog design fields
tvCustomerNameNumber = new TextView(this);
tvCustomerNameNumber.setTextSize(20);
baseLayout.addView(tvCustomerNameNumber);
// buttons
RelativeLayout.LayoutParams alignBotton = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT);
LinearLayout buttons = new LinearLayout(this);
buttons.setOrientation(LinearLayout.HORIZONTAL);
alignBotton.addRule(RelativeLayout.ALIGN_BOTTOM, baseLayout.getId());
// button edit
Button edit = new Button(this);
edit.setId(EDIT_BUTTON_ID); …
Run Code Online (Sandbox Code Playgroud) 在MSSQL中,我可以输入脚本编辑器并执行以下操作:
SELECT 'TEST' AS MyColumn
Run Code Online (Sandbox Code Playgroud)
这将在名为MyColumn的列中输出包含TEST的单行
Oracle中的等价物是什么?