fix a crash bug caused by load/store button id in details_activity

This commit is contained in:
iweizime
2017-09-10 10:51:51 +08:00
parent 0ae190c5f4
commit 10821519a0
@@ -235,9 +235,17 @@ public class StepData {
if (mSuAvailable) {
if (isRead && canRead()) {
((Activity) mContext).findViewById(mLoadButtonId).performClick();
try {
((Activity) mContext).findViewById(mLoadButtonId).performClick();
} catch (NullPointerException e) {
((Activity) mContext).findViewById(R.id.details_load_button).performClick();
}
} else if (canWrite()) {
((Activity) mContext).findViewById(mStoreButtonId).performClick();
try {
((Activity) mContext).findViewById(mStoreButtonId).performClick();
} catch (NullPointerException e) {
((Activity) mContext).findViewById(R.id.details_store_button).performClick();
}
}
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext)