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

Fatal Exception: java.lang.RuntimeException Unable to start activity ComponentInfo{de.tobin.anlagenstammblatt/de.tobin.anlagenstammblatt.MainActivity}: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? #16

Closed
Nibot1 opened this issue May 2, 2017 · 2 comments
Labels

Comments

@Nibot1
Copy link

Nibot1 commented May 2, 2017

Crashlytics - plaintext stacktrace downloaded by Tobin Rosenau at Tue, 02 May 2017 05:45:24 GMT # URL: https://fabric.io/haus3/android/apps/de.tobin.anlagenstammblatt/issues/590747a9be077a4dcc2888d5?time=last-seven-days/sessions/590747B4037400010F8653C5570F7C73_52bfc8ecdb384600aa61cac7290dd8e8_0_v1 # Organization: Haus # Platform: android # Application: Anlagenstammblatt # Version: N/A # Bundle Identifier: de.tobin.anlagenstammblatt # Issue #: 11 # Issue ID: 590747a9be077a4dcc2888d5 # Session ID: 590747B4037400010F8653C5570F7C73_52bfc8ecdb384600aa61cac7290dd8e8_0_v1 # Date: 2017-05-01T14:35:33Z # OS Version: 5.0.2 # Device: P023 # RAM Free: 52.3% # Disk Free: 20.5% #0. Crashed: main: 0 0 0x0000000000000000 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2321) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2381) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1286) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5260) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:678) -- Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{de.tobin.anlagenstammblatt/de.tobin.anlagenstammblatt.MainActivity}: 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.ActivityThread.performLaunchActivity(ActivityThread.java:2321) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2381) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1286) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5260) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:678) Caused by 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:1305) at android.app.ContextImpl.startActivity(ContextImpl.java:1292) at android.content.ContextWrapper.startActivity(ContextWrapper.java:329) at im.delight.android.location.SimpleLocation.openSettings(SimpleLocation.java:481) at de.tobin.anlagenstammblatt.MainActivity.onCreate(MainActivity.java:174) at android.app.Activity.performCreate(Activity.java:5975) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2274) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2381) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1286) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5260) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:678) #0. Crashed: main: 0 0 0x0000000000000000 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2321) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2381) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1286) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5260) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:678) #1. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #2. pool-3-thread-1 at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:410) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #3. FinalizerWatchdogDaemon at java.lang.Thread.sleep(Thread.java) at java.lang.Thread.sleep(Thread.java:1031) at java.lang.Thread.sleep(Thread.java:985) at java.lang.Daemons$FinalizerWatchdogDaemon.sleepFor(Daemons.java:257) at java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization(Daemons.java:268) at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:216) at java.lang.Thread.run(Thread.java:818) #4. HeapTrimmerDaemon at dalvik.system.VMRuntime.trimHeap(VMRuntime.java) at java.lang.Daemons$HeapTrimmerDaemon.run(Daemons.java:312) at java.lang.Thread.run(Thread.java:818) #5. main at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197) at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:397) at java.util.concurrent.FutureTask.get(FutureTask.java:174) at com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait(CrashlyticsBackgroundWorker.java:41) at com.crashlytics.android.core.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:285) at com.crashlytics.android.core.CrashlyticsController$5.onUncaughtException(CrashlyticsController.java:269) at com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:30) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690) #6. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #7. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #8. Crashlytics Exception Handler1 at dalvik.system.VMStack.getThreadStackTrace(VMStack.java) at java.lang.Thread.getStackTrace(Thread.java:580) at java.lang.Thread.getAllStackTraces(Thread.java:522) at com.crashlytics.android.core.CrashlyticsController.writeSessionEvent(CrashlyticsController.java:1114) at com.crashlytics.android.core.CrashlyticsController.writeFatal(CrashlyticsController.java:852) at com.crashlytics.android.core.CrashlyticsController.access$400(CrashlyticsController.java:59) at com.crashlytics.android.core.CrashlyticsController$6.call(CrashlyticsController.java:292) at com.crashlytics.android.core.CrashlyticsController$6.call(CrashlyticsController.java:285) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75) at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30) at java.lang.Thread.run(Thread.java:818) #9. Crashlytics Report Uploader at java.lang.Thread.sleep(Thread.java) at java.lang.Thread.sleep(Thread.java:1031) at java.lang.Thread.sleep(Thread.java:985) at com.crashlytics.android.core.ReportUploader$Worker.attemptUploadWithRetry(ReportUploader.java:188) at com.crashlytics.android.core.ReportUploader$Worker.onRun(ReportUploader.java:173) at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30) at java.lang.Thread.run(Thread.java:818) #10. GCDaemon at java.lang.Object.wait(Object.java) at java.lang.Daemons$GCDaemon.run(Daemons.java:341) at java.lang.Thread.run(Thread.java:818) #11. FinalizerDaemon at java.lang.Object.wait(Object.java) at java.lang.Object.wait(Object.java:422) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:101) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:72) at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:173) at java.lang.Thread.run(Thread.java:818) #12. Answers Events Handler1 at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1048) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:776) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75) at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30) at java.lang.Thread.run(Thread.java:818) #13. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #14. ReferenceQueueDaemon at java.lang.Object.wait(Object.java) at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:133) at java.lang.Thread.run(Thread.java:818) #15. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

@ocram ocram added the question label May 2, 2017
@ocram
Copy link
Contributor

ocram commented May 2, 2017

The error message explains it all. It's not a bug in this library but something that is wrong in your app. In line 174 of MainActivity.java, which is in the onCreate method of the MainActivity class, you're calling the openSettings method from this library's SimpleLocation class, which opens the settings of the device. You're calling this from a wrong Context or supplying a wrong Context. So you must not call openSettings in that place or with that argument.

@ocram ocram closed this as completed May 2, 2017
@Nibot1
Copy link
Author

Nibot1 commented May 2, 2017

Ok Thanks

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

No branches or pull requests

2 participants