Occurs on the lock screen [ Performing stop of activity that is already stopped :...
I implemented the Android lock screen app.
An RuntimeException occurred while executing the LockScreenActivity(Regardless of the Android version).
But this Exception is occurs very intermittentl and it is not reported to Crashlytics.
The Exception content is :
2018-11-20 16:09:10.037 7657-7657/hanmo.com.drinkingwaterassistant E/ActivityThread: Performing stop of activity that is already stopped: {hanmo.com.drinkingwaterassistant/hanmo.com.drinkingwaterassistant.lockscreen.LockScreenActivity}
java.lang.RuntimeException: Performing stop of activity that is already stopped: {hanmo.com.drinkingwaterassistant/hanmo.com.drinkingwaterassistant.lockscreen.LockScreenActivity}
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4200)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4288)
at android.app.ActivityThread.-wrap25(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1730)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
First, I reproduced this intermittent exception to occur when I wanted to.
The conditions for reproduction are as follows.
- Given : The lock screen Activity is running.
- When : startActivity to transparent activities
- Then : occurs Exception that (performing stop of activity that is already stopped)
Style for transparent activity :
<style name="transparentView" parent="android:Theme.Translucent">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
Occurs when transparent Activity appeared on the lockScreenActivity.
So I made a non-transparent lockScreenActivity. However, Exception persisted intermittently.
I want to know the cause of this Exception.
Here are my suspicious parts of LockScreenActivity.
Manifest
<activity android:name=".lockscreen.LockScreenActivity"
android:showOnLockScreen="true"
android:launchMode="singleInstance" />
onWindowFocusChanged in LockScreenActivity
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (hasFocus) window.decorView.systemUiVisibility = (
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
)
}
}
onAttachedToWindow in LockScreenActivity
override fun onAttachedToWindow() {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
or WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
or WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
)
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
super.onAttachedToWindow()
}
Admob in LockScreenActivity
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/transparent"
app:adSize="SMART_BANNER"
app:adUnitId="@string/admobBanner"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" />
And My LockScreenActivity Example is here
add a comment |
I implemented the Android lock screen app.
An RuntimeException occurred while executing the LockScreenActivity(Regardless of the Android version).
But this Exception is occurs very intermittentl and it is not reported to Crashlytics.
The Exception content is :
2018-11-20 16:09:10.037 7657-7657/hanmo.com.drinkingwaterassistant E/ActivityThread: Performing stop of activity that is already stopped: {hanmo.com.drinkingwaterassistant/hanmo.com.drinkingwaterassistant.lockscreen.LockScreenActivity}
java.lang.RuntimeException: Performing stop of activity that is already stopped: {hanmo.com.drinkingwaterassistant/hanmo.com.drinkingwaterassistant.lockscreen.LockScreenActivity}
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4200)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4288)
at android.app.ActivityThread.-wrap25(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1730)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
First, I reproduced this intermittent exception to occur when I wanted to.
The conditions for reproduction are as follows.
- Given : The lock screen Activity is running.
- When : startActivity to transparent activities
- Then : occurs Exception that (performing stop of activity that is already stopped)
Style for transparent activity :
<style name="transparentView" parent="android:Theme.Translucent">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
Occurs when transparent Activity appeared on the lockScreenActivity.
So I made a non-transparent lockScreenActivity. However, Exception persisted intermittently.
I want to know the cause of this Exception.
Here are my suspicious parts of LockScreenActivity.
Manifest
<activity android:name=".lockscreen.LockScreenActivity"
android:showOnLockScreen="true"
android:launchMode="singleInstance" />
onWindowFocusChanged in LockScreenActivity
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (hasFocus) window.decorView.systemUiVisibility = (
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
)
}
}
onAttachedToWindow in LockScreenActivity
override fun onAttachedToWindow() {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
or WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
or WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
)
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
super.onAttachedToWindow()
}
Admob in LockScreenActivity
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/transparent"
app:adSize="SMART_BANNER"
app:adUnitId="@string/admobBanner"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" />
And My LockScreenActivity Example is here
Except for the anxious partonWindowFocusChanged, I tried the test, but the exception occurred consistently. I also tried to handle theWindowManager.LayoutParams.FLAG_DISMISS_KEYGUARDandWindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKEDofonAttachedToWindowinonCreate, but I experienced the same exception.
– hanmolee
Nov 22 at 1:12
I checked the logcat to see what happens on other lock screen apps that I have created.
– hanmolee
Nov 22 at 1:13
add a comment |
I implemented the Android lock screen app.
An RuntimeException occurred while executing the LockScreenActivity(Regardless of the Android version).
But this Exception is occurs very intermittentl and it is not reported to Crashlytics.
The Exception content is :
2018-11-20 16:09:10.037 7657-7657/hanmo.com.drinkingwaterassistant E/ActivityThread: Performing stop of activity that is already stopped: {hanmo.com.drinkingwaterassistant/hanmo.com.drinkingwaterassistant.lockscreen.LockScreenActivity}
java.lang.RuntimeException: Performing stop of activity that is already stopped: {hanmo.com.drinkingwaterassistant/hanmo.com.drinkingwaterassistant.lockscreen.LockScreenActivity}
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4200)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4288)
at android.app.ActivityThread.-wrap25(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1730)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
First, I reproduced this intermittent exception to occur when I wanted to.
The conditions for reproduction are as follows.
- Given : The lock screen Activity is running.
- When : startActivity to transparent activities
- Then : occurs Exception that (performing stop of activity that is already stopped)
Style for transparent activity :
<style name="transparentView" parent="android:Theme.Translucent">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
Occurs when transparent Activity appeared on the lockScreenActivity.
So I made a non-transparent lockScreenActivity. However, Exception persisted intermittently.
I want to know the cause of this Exception.
Here are my suspicious parts of LockScreenActivity.
Manifest
<activity android:name=".lockscreen.LockScreenActivity"
android:showOnLockScreen="true"
android:launchMode="singleInstance" />
onWindowFocusChanged in LockScreenActivity
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (hasFocus) window.decorView.systemUiVisibility = (
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
)
}
}
onAttachedToWindow in LockScreenActivity
override fun onAttachedToWindow() {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
or WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
or WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
)
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
super.onAttachedToWindow()
}
Admob in LockScreenActivity
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/transparent"
app:adSize="SMART_BANNER"
app:adUnitId="@string/admobBanner"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" />
And My LockScreenActivity Example is here
I implemented the Android lock screen app.
An RuntimeException occurred while executing the LockScreenActivity(Regardless of the Android version).
But this Exception is occurs very intermittentl and it is not reported to Crashlytics.
The Exception content is :
2018-11-20 16:09:10.037 7657-7657/hanmo.com.drinkingwaterassistant E/ActivityThread: Performing stop of activity that is already stopped: {hanmo.com.drinkingwaterassistant/hanmo.com.drinkingwaterassistant.lockscreen.LockScreenActivity}
java.lang.RuntimeException: Performing stop of activity that is already stopped: {hanmo.com.drinkingwaterassistant/hanmo.com.drinkingwaterassistant.lockscreen.LockScreenActivity}
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4200)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4288)
at android.app.ActivityThread.-wrap25(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1730)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
First, I reproduced this intermittent exception to occur when I wanted to.
The conditions for reproduction are as follows.
- Given : The lock screen Activity is running.
- When : startActivity to transparent activities
- Then : occurs Exception that (performing stop of activity that is already stopped)
Style for transparent activity :
<style name="transparentView" parent="android:Theme.Translucent">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
Occurs when transparent Activity appeared on the lockScreenActivity.
So I made a non-transparent lockScreenActivity. However, Exception persisted intermittently.
I want to know the cause of this Exception.
Here are my suspicious parts of LockScreenActivity.
Manifest
<activity android:name=".lockscreen.LockScreenActivity"
android:showOnLockScreen="true"
android:launchMode="singleInstance" />
onWindowFocusChanged in LockScreenActivity
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (hasFocus) window.decorView.systemUiVisibility = (
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
)
}
}
onAttachedToWindow in LockScreenActivity
override fun onAttachedToWindow() {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
or WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
or WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
)
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
super.onAttachedToWindow()
}
Admob in LockScreenActivity
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/transparent"
app:adSize="SMART_BANNER"
app:adUnitId="@string/admobBanner"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" />
And My LockScreenActivity Example is here
edited Nov 20 at 7:58
asked Nov 20 at 7:53
hanmolee
184
184
Except for the anxious partonWindowFocusChanged, I tried the test, but the exception occurred consistently. I also tried to handle theWindowManager.LayoutParams.FLAG_DISMISS_KEYGUARDandWindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKEDofonAttachedToWindowinonCreate, but I experienced the same exception.
– hanmolee
Nov 22 at 1:12
I checked the logcat to see what happens on other lock screen apps that I have created.
– hanmolee
Nov 22 at 1:13
add a comment |
Except for the anxious partonWindowFocusChanged, I tried the test, but the exception occurred consistently. I also tried to handle theWindowManager.LayoutParams.FLAG_DISMISS_KEYGUARDandWindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKEDofonAttachedToWindowinonCreate, but I experienced the same exception.
– hanmolee
Nov 22 at 1:12
I checked the logcat to see what happens on other lock screen apps that I have created.
– hanmolee
Nov 22 at 1:13
Except for the anxious part
onWindowFocusChanged, I tried the test, but the exception occurred consistently. I also tried to handle the WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD and WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED of onAttachedToWindow in onCreate, but I experienced the same exception.– hanmolee
Nov 22 at 1:12
Except for the anxious part
onWindowFocusChanged, I tried the test, but the exception occurred consistently. I also tried to handle the WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD and WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED of onAttachedToWindow in onCreate, but I experienced the same exception.– hanmolee
Nov 22 at 1:12
I checked the logcat to see what happens on other lock screen apps that I have created.
– hanmolee
Nov 22 at 1:13
I checked the logcat to see what happens on other lock screen apps that I have created.
– hanmolee
Nov 22 at 1:13
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53388463%2foccurs-on-the-lock-screen-performing-stop-of-activity-that-is-already-stopped%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53388463%2foccurs-on-the-lock-screen-performing-stop-of-activity-that-is-already-stopped%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Except for the anxious part
onWindowFocusChanged, I tried the test, but the exception occurred consistently. I also tried to handle theWindowManager.LayoutParams.FLAG_DISMISS_KEYGUARDandWindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKEDofonAttachedToWindowinonCreate, but I experienced the same exception.– hanmolee
Nov 22 at 1:12
I checked the logcat to see what happens on other lock screen apps that I have created.
– hanmolee
Nov 22 at 1:13