SettingsPreferenceFragment extends PreferenceFragment
is defined as a member class (member class) of SettingsActivity extends AppCompatActivity
.
When I called ʻActivityCompat.requestPermissions ()with
SettingsPreferenceFragment and tried to receive it with ʻonRequestPermissionsResult ()
, it was not called for some reason.
The reason was very simple.
When I called ʻActivityCompat.requestPermissions (), in this case
SettingsActivity.onRequestPermissionsResult ()` was called.
Called after moving ʻonRequestPermissionsResult ()to
SettingsActivity`.
Let's read the reference properly
Recommended Posts