android-permissions

permission for accessing WIFI in android 6

ε祈祈猫儿з 提交于 2019-12-24 06:44:26
问题 I am new to android studio, i was previously working on android version 5.1 for my app and it worked fine but now in 6 i am not able to get permission or i am not sure if my method is wrong. I am making an app which uses the list of access points available for my mobile. But even though i am granted permission my app does not show me the wifi list but the same code works well for earlier versions. Mainactivity: package com.wiferange.wifi_test; import android.Manifest; import android.content

permission for accessing WIFI in android 6

巧了我就是萌 提交于 2019-12-24 06:44:19
问题 I am new to android studio, i was previously working on android version 5.1 for my app and it worked fine but now in 6 i am not able to get permission or i am not sure if my method is wrong. I am making an app which uses the list of access points available for my mobile. But even though i am granted permission my app does not show me the wifi list but the same code works well for earlier versions. Mainactivity: package com.wiferange.wifi_test; import android.Manifest; import android.content

Not call onRequestPermissionsResult from fragment

霸气de小男生 提交于 2019-12-24 06:13:37
问题 In my android project, I use this code to check & request runtime permissions: public class AgentsFragmentMapTab extends RootFragment implements ActivityCompat.OnRequestPermissionsResultCallback { //.. private boolean checkAndRequestPermissions() { int internet = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.INTERNET); int loc = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION); int loc2 = ContextCompat.checkSelfPermission

Getting permission denied on Android M

雨燕双飞 提交于 2019-12-24 05:53:12
问题 I'm getting PERMISSION_DENIED for WRITE_EXTERNAL_STORAGE that is in fact active: I'm using a library called Permiso to retrieve them: private void attemptStartImagePicker() { Permiso.getInstance().requestPermissions(new Permiso.IOnPermissionResult() { @Override public void onPermissionResult(Permiso.ResultSet resultSet) { if (!resultSet.isPermissionGranted(Manifest.permission.READ_EXTERNAL_STORAGE) || !resultSet.isPermissionGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {

Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState [duplicate]

一笑奈何 提交于 2019-12-24 05:46:28
问题 This question already has answers here : getting exception “IllegalStateException: Can not perform this action after onSaveInstanceState” (31 answers) Closed 3 years ago . I am trying to get permissions for reading calendar, after getting the permissions I am trying to call another fragment. I am stuck with the following exception.This happens for the first launch of the application only.For the next launch application works fine. 5488-5488/com.mindtree.calenderevents E/AndroidRuntime: FATAL

Android: new permissions added behind my back after library updates

懵懂的女人 提交于 2019-12-24 03:46:13
问题 When I uploaded a new version of my app to the Developer Console for uploading to the Play Store, the dialog that pops up with an analysis of the apk told me that I had added two new permissions since the last version: android.permission.READ_EXTERNAL_STORAGE maxSdkVersion=18 android.permission.WRITE_EXTERNAL_STORAGE AFAIK I've done nothing in my code to add these permissions; certainly there is nothing in 'AndroidManifest.xml'. I have no interest or need to read and write to external storage

Getting FileNotFoundException on Android app after denying and than granting permission at runtime

青春壹個敷衍的年華 提交于 2019-12-24 02:18:31
问题 I'm trying to to get an app to play an mp3 from the sd card. I'm using the android sdk version 23, with Android studio on Windows 8. I'm running this on the nexus 5 emulator. I'm requesting permission at runtime and I'm getting a FileNotFoundException if I deny the permission once but than grant the permission on the second request. If I restart the app, I'm able to play the music file and if I accept the permission request on the first try it also successfully plays the music without

android - close app if user not granting WRITE_EXTERNAL_STORAGE permission

烂漫一生 提交于 2019-12-24 00:48:12
问题 in android 6 or above when user open app first time ask him for some permission if he dont allow then exit app some must required permission for my app is read and write to external storage, how to achieve this i tried this if (Build.VERSION.SDK_INT >= 23) { if (ContextCompat.checkSelfPermission(LoginActivity.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(LoginActivity.this, android.Manifest.permission.READ

android.permission.WRITE_MEDIA_STORAGE error

点点圈 提交于 2019-12-24 00:45:36
问题 I am working on an app that edits text files. I am able to r/w files when they are opened via an ACTION_OPEN_DOCUMENT activity: Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); It all works just right on both internal and external SD storage. I have also set up the app with an intent-filter for android.intent.action.VIEW. The app shows up in the "chooser" in the Android MyFiles

GoogleAccountCredential.setSelectedAccountName(String) not working on Android 6.0 without Contacts permission

牧云@^-^@ 提交于 2019-12-23 12:59:25
问题 I'm retrieving an GoogleAccountCredential object using: GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2( context, Arrays.asList({ GmailScopes.MAIL_GOOGLE_COM })) .setBackOff(new ExponentialBackOff()) .setSelectedAccountName(email) with email being the Gmail account I'm using on the device. If I retrieve the account name using credential.getSelectedAccountName the result is null. This happens only on devices running Android Marshmallow and only if the app does NOT have