एंड्रॉइड 22> के लिए मेनिफेस्ट अनुमति काम नहीं करती है। तो आपके मामले में, आपको रनटाइम अनुमति तक पहुंचने की आवश्यकता है। जावा में यह प्रदर्शन।
if (ContextCompat.checkSelfPermission(thisActivity,
Manifest.permission.READ_CONTACTS)
!= PackageManager.PERMISSION_GRANTED) {
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(thisActivity,
Manifest.permission.READ_CONTACTS)) {
// Show an explanation to the user *asynchronously* -- don't block
// this thread waiting for the user's response! After the user
// sees the explanation, try again to request the permission.
} else {
// No explanation needed, we can request the permission.
ActivityCompat.requestPermissions(thisActivity,
arrayOf(Manifest.permission.READ_CONTACTS),
MY_PERMISSIONS_REQUEST_READ_CONTACTS)
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// app-defined int constant. The callback method gets the
// result of the request.
}
}
Official Doc से देखें। लेकिन आपके मामले में, मुझे लगता है कि आपको एक ही व्यवहार को कॉल करने के लिए एनडीके के माध्यम से स्तर की आवश्यकता है। यह here भी वर्णित है।
एंड्रॉयड के लिए, आप बस AndroidManifest.xml करने के लिए अनुमति जोड़ सकते हैं - विवरण [यहां] (http://doc.qt.io/qtcreator/creator-deploying-android.html) – Skynet
@Derek, मुझे जानकर खुशी हो रही है, क्या आपको इसके लिए समाधान मिला, क्योंकि मैं एक ही स्थिति में हूं। अग्रिम में धन्यवाद। अद्यतन के लिए –