Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

callback compatibility issue when initialing method #952

Open
PSDroid2022 opened this issue Mar 16, 2022 · 0 comments
Open

callback compatibility issue when initialing method #952

PSDroid2022 opened this issue Mar 16, 2022 · 0 comments

Comments

@PSDroid2022
Copy link

We confirm a callback compatibility issue which might threaten the robustness of your app and give a detailed suggestion for you.

In ''com.kabouzeid.gramophone.ui.activities.base.AbsBaseActivity", you super the framework API "<android.app.Activity: void onRequestPermissionsResult(int,java.lang.String[],int[])>" in "onRequestPermissionsResult" method as shown in following. But actually, this API is added in level 23 (https://developer.android.google.cn/reference/android/app/Activity?hl=en#onRequestPermissionsResult(int,%20java.lang.String[],%20int[])).

 @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        ...
    }

So when the app try to initial related Toast on devices SDK version 16 to 22, your app will run with an unpredictable results. So we suggest you add an "if(SDK_INT>= 23)", " @TargetApi(Build.VERSION_CODES.M)" or change your app miniSDK from 16 to 23 to fix this potential issue.
By the way, "@TargetApi(Build.VERSION_CODES.M)" will be deleted by Android compiler when releasing APKs, so it seems like a not good way to solve those issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant