Android examples for android.content:Context
Checks if a Context is not null and is not finishing and returns true, otherwise false
import android.app.Activity; import android.app.ActivityManager; import android.content.Context; public class Main{ /**/*from ww w . j a v a2 s. c o m*/ * Checks if a Context is not null and is not finishing and returns true, otherwise false. */ public static boolean isContextValid(Activity context) { if (context != null && !context.isFinishing()) { return true; } return false; } }