I get an error
java.lang.NoSuchMethodError: android.app.Activity.isDestroyed
It has something to do with only running on devices which are api 17 or higher, is there anyway around this?
private WeakReference<Activity> mActivityRef; @Override public void onFinish() { Activity activity = mActivityRef.get(); // if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { //do your thing! if (activity != null && !activity.isFinishing() && !activity.isDestroyed()) { activity.startActivity(new Intent(activity, ListOfAlarms.class)); activity.finish(); } mStarted = false; // } // Intent goBack = new Intent(CountDownAct.this, ListOfAlarms.class); // startActivity(goBack); // finish(); }