티스토리 뷰
Context is removed when activity called onDestroy().
So when after called context, It goes to error.
So please reference next solution code.
# Example Resolution Code
if ( context instanceof Activity ) {
Activity activity = (Activity)context;
if ( activity.isFinishing() ) {
return;
}
}
Toast.makeText(context, "I'll do things here that depend on my context and views being valid", Toast.LENGTH_SHORT).show();
#Reference Link
https://stackoverflow.com/questions/7856103/how-can-i-tell-if-my-context-is-still-valid
'Computer > Android' 카테고리의 다른 글
[Android][Error] Error while merging dex archives (0) | 2019.06.26 |
---|---|
AdMob 모바일 광고 SDK (0) | 2019.06.26 |
[Android] 다른 Activity의 ListView새로고침하기 (notifyDataSetChanged) (0) | 2019.05.15 |
Calling ui thread from worker thread (0) | 2019.02.13 |
Google Android Sample Code Git (0) | 2019.02.09 |
댓글