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

Resuming registration with no background processes crashes in RegistrationActivity #35

Open
zippert opened this issue Mar 28, 2017 · 3 comments

Comments

@zippert
Copy link

zippert commented Mar 28, 2017

If user has disallowed background-processes on Android device (Settings->Developer options->Background process limit->"No Background processes") and exits launching(/host) application after setting context:

com.klarna.ondemand.Context.setApiKey(apiKey);

and launching the RegistrationActivity:

        Intent intent = new Intent(this, RegistrationActivity.class);
        RegistrationSettings settings = new RegistrationSettings(normalizedNumber, confirmedUserDataId);
        intent.putExtra(RegistrationActivity.EXTRA_SETTINGS, settings);
        startActivityForResult(intent, REGISTRATION_REQUEST_CODE);

When the "Klarna-logo" is shown, press home and open another application. Then bring up the (host) application via "Recent apps". Application crashes:

03-28 11:06:10.784 2841 2841 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{se.skanetrafiken.washington.dev/com.klarna.ondemand.RegistrationActivity}: java.lang.RuntimeException: You must set the API key first.
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2464)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.app.ActivityThread.access$900(ActivityThread.java:154)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.os.Looper.loop(Looper.java:234)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5526)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: Caused by: java.lang.RuntimeException: You must set the API key first.
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at com.klarna.ondemand.Context.getApiKey(Context.java:25)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at com.klarna.ondemand.UrlHelper.getAuthority(UrlHelper.java:15)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at com.klarna.ondemand.UrlHelper.registrationUrl(UrlHelper.java:24)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at com.klarna.ondemand.RegistrationActivity.getUrl(RegistrationActivity.java:32)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at com.klarna.ondemand.RegistrationActivity.onCreate(RegistrationActivity.java:28)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6285)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
03-28 11:06:10.784 2841 2841 E AndroidRuntime: ... 9 more

When switching back (where the crash occurs), the Klarna-Activity receives focus and cannot be prevented/fixed from the host application.

@danevron
Copy link

danevron commented Mar 30, 2017

This issue is addressed in #36

@zippert
Copy link
Author

zippert commented Mar 31, 2017

When will this be made as a deliverable to us?

@danevron
Copy link

danevron commented Apr 3, 2017 via email

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

2 participants