Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog and Notification not shown #478

Closed
hannesa2 opened this issue Jun 29, 2016 · 5 comments
Closed

Dialog and Notification not shown #478

hannesa2 opened this issue Jun 29, 2016 · 5 comments

Comments

@hannesa2
Copy link

hannesa2 commented Jun 29, 2016

I'm able to send with http PUT, but when I use
ReportingInteractionMode.DIALOG
or
ReportingInteractionMode.NOTIFICATION
only a toast is shown. Short: I'm not able to make it work

Is there a sample app where I can see, how does it works ?

I use

compile 'ch.acra:acra:4.9.0'

Thank you !

@F43nd1r
Copy link
Member

F43nd1r commented Jun 29, 2016

Example is here: https://github.com/ACRA/acra/wiki/AdvancedUsage#dialog
If tghat doesn't help, show some code.

@hannesa2
Copy link
Author

I know this, I'm looking for some (cloneable) running code.

@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(this);
    //http
    configurationBuilder
        .setHttpMethod(HttpSender.Method.PUT)
        .setFormUri(getString(R.string.crash_report_url))
        .setReportType(HttpSender.Type.JSON);
    //dialog
    configurationBuilder
        .setResDialogTitle(R.string.crash_dialog_title)
        .setResDialogText(R.string.crash_dialog_text)
        .setResDialogCommentPrompt(R.string.crash_dialog_comment_prompt)
        .setResDialogEmailPrompt(R.string.crash_dialog_email_prompt)
        .setResDialogOkToast(R.string.crash_dialog_ok_toast)
        //notification
        .setResNotifTickerText(R.string.crash_dialog_text)
        .setResNotifTitle(R.string.crash_dialog_text)
        .setResNotifText(R.string.crash_dialog_text)
        .setResToastText(R.string.crash_dialog_text)
        .setReportingInteractionMode(ReportingInteractionMode.DIALOG);
    configuration = configurationBuilder.build();
    ACRA.init(this, configuration, true);
}

and in main app, for test purpose I do this in in an button onClick()
init i = 1/0;
or this

        AsyncTask task = new AsyncTask() {
            @Override
            protected Object doInBackground(Object[] params) {
                int i = 5/0;
                return null;
            }
        };
        task.execute();

with the result, of a short toast, and my app disappears.
My most preferred behavior is a dialog and a not disappeared app

@hannesa2
Copy link
Author

I figured out, when I first time start form Android Studio, the app disappears. Then app is disconnected to debugger.
After a second start, without debugging, it shows the dialog (or notification)
Here is a screen cast (fist time is connected to debugger)

screencast-acra-dialog.webm.zip

I also made a simple test app, to demonstrate https://github.com/hannesa2/acra_dialog

@F43nd1r
Copy link
Member

F43nd1r commented Jun 30, 2016

I have seen the debugger influencing ACRA too. I have no idea what the debugger does, but it seems to be a problem for ACRA.

@william-ferguson-au
Copy link
Member

#495 makes using a debugger with ACRA much nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants