pslab-android
pslab-android copied to clipboard
Compatibility issue when calling method
We confirm a compatibility issue which might threaten the robustness of your app and give a detailed suggestion for you.
In ''io.pslab.activity.LuxMeterActivity", you invoke the framework API "<android.os.BaseBundle: long getLong(java.lang.String)>" in "getDataFromDataLogger" method as shown in following. But actually, this method is introduced after API level 21 (https://developer.android.google.cn/reference/kotlin/android/os/BaseBundle?hl=en#getLong(kotlin.String)).
@Override
public void getDataFromDataLogger() {
if (getIntent().getExtras() != null && getIntent().getExtras().getBoolean(KEY_LOG)) {
//playingData = true;
viewingData = true;
recordedLuxData = LocalDataLog.with()
.getBlockOfLuxRecords(getIntent().getExtras().getLong(DATA_BLOCK));
final LuxData data = recordedLuxData.get(0);
if (data != null) {
final String title = titleFormat.format(data.getTime());
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setTitle(title);
}
}
}
}
}
So when the app try to invoke this API on devices before API level 21, your app will run with an unpredictable results. So we suggest you add an "if(SDK_INT >= 21)" to fix this potential issue.
Android device
- Device: [e.g. Emulator]
- OS: [e.g. API 19]
- PSLab Version: [2.0.10]
install app on devices with API 19, open PSLab with crash.

Would you like to work on the issue? Yes