在我的应用程序类中,我有这个方法,我调用我的应用程序的 onCreate:
public void initInstabug() {
try {
instabug = new Instabug.Builder(this, "45c752889689ac2ae0840d11e2a5f628")
.setDebugEnabled(true)
.setEmailFieldRequired(true)
.setFloatingButtonOffsetFromTop(400)
.setShouldShowIntroDialog(true)
.setColorTheme(IBGColorTheme.IBGColorThemeLight)
.setCommentFieldRequired(true)
.setInvocationEvent(IBGInvocationEvent.IBGInvocationEventShake)
.build();
instabug.setPrimaryColor(getResources().getColor(R.color.background));
instabug.setPreSendingRunnable(new Runnable() {
@Override
public void run() {
Log.i("","instabug entered pre sending runnable");
String[] files = new String[2];
files[0] = Environment.getExternalStorageDirectory() + "/Passenger/passenger_log.txt";
files[1] = Environment.getExternalStorageDirectory() + "/Passenger/passenger_log2.txt";
Compress compress = new Compress(files, Environment.getExternalStorageDirectory() + "/Passenger/log.zip");
compress.zip(new CrudStateCallback() {
@Override
public void onResponse(String string) {
Log.i("", "instabug ended making the archive");
}
});
}
});
File file = new File(Environment.getExternalStorageDirectory() + "/Passenger/log.zip");
Uri uri = Uri.fromFile(file);
instabug.setFileAttachment(uri, null);
}catch (Exception e){
Log.e("","error instabug:" + e.getMessage());
Utils.appendLog("In case instabug crashes asyncTask process, will not crash app",true);
}
}
我的问题是我首先有登录页面,并且在我通常写我的登录信息(电子邮件,密码)时总是出现弹出窗口。是否可以延迟 introDialog,所以它只会在另一个活动打开时出现?如您所见,我尝试在 Application 中使用此代码初始化我的 instabug 实例,其中 .setShouldShowIntroDialog(FALSE) 设置为 false。然后在时间轴中,我使用 .setShouldShowIntroDialog(true) 重新初始化它。但它根本不像这样显示。