Onrequestpermissionsresult Called In Homeactivity But Not In Fragment
In a fragment I call requestPermissions public class FgDialogFragment extends DialogFragment { requestPermissions(new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE},2
Solution 1:
The requestPermissions
call is only available within an Activity. There is also an ActivityCompat.requestPermissions
, but that also takes an Activity
context for the callback.
The callback will only work within an activity. I suggest either you create a listener you can call into your fragment or use an event bus.
Post a Comment for "Onrequestpermissionsresult Called In Homeactivity But Not In Fragment"