Santosh
Santosh

Reputation: 27

Android application crash reported by google play crash report

I got a below crash report in my android application from google play

android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:625)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:258)
at android.webkit.CallbackProxy.uiOverrideUrlLoading(CallbackProxy.java:229)
at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:336)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4633)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)

I am not sure if its my coding mistake or its a Android bug. Could you please help me in understanding this issue.

Thank you.

Upvotes: 1

Views: 308

Answers (1)

Trinimon
Trinimon

Reputation: 13957

There is a flag missing in your intent:

Intent intent = new Intent(this, SomeActivity.class);
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(intent);

Hope this helps .... Cheers!

Upvotes: 1

Related Questions