我可以延迟instabug IntroDialog吗?

时间:2016-07-15 15:28:17

标签: android dialog delay builder instabug

在我的Application类中,我有这个方法,我在我的应用程序的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)重新启动它。但它并没有像这样表现出来。

1 个答案:

答案 0 :(得分:3)

您可以尝试在活动中使用Instabug.showIntroMessage(),并将.setShouldShowIntroDialog()设置为false。