NoSuchMethod: isDestroyed()
Activity.isDestroyed()
is available starting at API level 17. If your application settings are for a lower API, you'll get this Exception
.
You can write like this to avoid the problem:
if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) {
if (!act.isDestroyed()) {
act.overridePendingTransition(0, 0);
act.finish();
}
}
According to Activity.onDestroyed(), this is available in API Level 17 and up which is the latest Android version 4.2+
What Android version are you trying to run this code on?