티스토리 뷰

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

댓글

파트너스 활동을 통해 일정액의 수수료를 제공받을 수 있음



Total
Today
Yesterday
최근에 달린 댓글