Android memo-I was addicted to Permission

What happened

SettingsPreferenceFragment extends PreferenceFragment is defined as a member class (member class) of SettingsActivity extends AppCompatActivity.

When I called ʻActivityCompat.requestPermissions ()withSettingsPreferenceFragment and tried to receive it with ʻonRequestPermissionsResult (), it was not called for some reason.

What happened

The reason was very simple. When I called ʻActivityCompat.requestPermissions (), in this case SettingsActivity.onRequestPermissionsResult ()` was called.

Called after moving ʻonRequestPermissionsResult ()toSettingsActivity`.

Summary

Let's read the reference properly

Recommended Posts

Android memo-I was addicted to Permission
I was addicted to starting sbt
I was addicted to rewriting to @SpringApplicationConfiguration-> @SpringBootTest
I was addicted to the roll method
I was addicted to using RXTX on Sierra
I was addicted to installing Ruby/Tk on MacOS
I was addicted to the record of the associated model
Introduction to Android Layout
GetXxxx of ResultSet was addicted to primitive type (Java)
A memorandum because I was addicted to the setting of the Android project of IntelliJ IDEA
Android permission request (plural)
I was addicted to WSl when trying to build an android application development environment with Vue.js
What I was addicted to when introducing the JNI library
What I fixed when updating to Spring Boot 1.5.12 ・ What I was addicted to
What I was addicted to while using rspec on rails
I was addicted to setting default_url_options with Rails devise introduction
I was addicted to looping the Update statement on MyBatis
What I was addicted to with the Redmine REST API
I was addicted to using Java's Stream API in Scala
The story I was addicted to when setting up STS
Technical causes and countermeasures for the points I was addicted to with the first Android app & Kotlin
Introduction to Android application development
[Android] Connect to MySQL (unfinished)
[Circle CI] A story I was addicted to at Start Building
A note when I was addicted to converting Ubuntu on WSL1 to WSL2
About the matter that I was addicted to how to use hashmap
I was addicted to the API version min23 setting of registerTorchCallback