【发布时间】:2010-09-06 06:28:55
【问题描述】:
有人抱怨我的应用程序在启动时获得了 FC(而其他人从未遇到过任何问题)。这是我的完整活动来源。由于它发生在我不拥有的设备上,我无法修复它。从他们告诉我的情况来看,它不起作用:摩托罗拉 Blackflip、摩托罗拉 Dext、摩托罗拉 CLIQ XT。猜猜摩托罗拉毕竟不喜欢我的应用程序......
可能是我允许 minSdkVersion="3" 吗?我在模拟器上测试了 1.5 并且运行良好...
提前感谢您的回复。
public class workit extends Activity implements OnClickListener {
Button yay;
Button yay0;
Button yay1;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
yay = (Button) findViewById(R.id.gostart);
yay.setOnClickListener(this);
yay0 = (Button) findViewById(R.id.dontstart);
yay0.setOnClickListener(this);
yay1 = (Button) findViewById(R.id.exit);
yay1.setVisibility(ImageView.GONE);
ImageView inizio = (ImageView)findViewById(R.id.start);
inizio.setVisibility(ImageView.VISIBLE);
inizio.setBackgroundResource(R.drawable.start);
}
public void onClick(View v) {
// TODO Auto-generated method stub
if (v == yay0) {
finish();
}
if (v == yay) {
ImageView inizio = (ImageView)findViewById(R.id.start);
inizio.setVisibility(ImageView.GONE);
WebView work = new WebView(this);
setContentView(work);
work.loadUrl("file:///android_asset/index1.html");
work.setWebViewClient( new work());
work.setBackgroundColor(0);
work.getSettings().setBuiltInZoomControls(true);
work.getSettings().setDefaultZoom(ZoomDensity.FAR);
}
if (v == yay1) {
finish();
}
}
private class work extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains("exit.html")) {
// TODO: do what you have to do
finish();
}
view.loadUrl(url);
return true;
}
}
}
【问题讨论】:
-
你应该看看这个崩溃报告库,我使用它,它运行良好,将崩溃报告发送到谷歌电子表格。所以你不依赖市场错误报告或任何分钟。操作系统版本。 code.google.com/p/acra
-
谢谢,我去看看,回来报告结果。
-
报告令人惊叹。我在那里发现了很多有趣的统计数据!感谢您分享这个!
标签: android onclick webview imageview