android-permissions

Access external storage in File Chooser

一笑奈何 提交于 2019-11-29 12:01:05
I am trying to implement a File Chooser. I am using Android File Explore for file chooser in my app. When I run the app, it shows me Internal storage and returns me the file path, but it doesn't show External Storage at all. This is my AndroidManifest.xml file. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unicloud.mittal" > <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" /

How to disable animations in code when running Espresso tests

江枫思渺然 提交于 2019-11-29 09:31:25
问题 Has anybody managed to disable animations through code when running Espresso tests? I've been trying to follow the instructions in this webpage (linked to from here): https://code.google.com/p/android-test-kit/wiki/DisablingAnimations Unfortunately it does not appear to be working, as I keep seeing this permissions error: 04-27 15:48:28.694 303-342/system_process W/PackageManager﹕ Not granting permission android.permission.SET_ANIMATION_SCALE to package com.cookbrite.dev (protectionLevel=50

No activity found to handle intent action.dial

依然范特西╮ 提交于 2019-11-29 09:09:49
I'm trying to make my app call a number from an EditText, but I get: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.DIAL dat=Ring Tel nr. 123456789 } I've searched a while for an answer, but most of the answes are permissions and add activity to the Manifest. I've done both, if I'm not doing it wrong. And I'm running it on my phone, not the emulator. I've tried both with and without the intent-filters. Here are the codes: Manifest: <uses-permission android:maxSdkVersion="19" android:name="android.permission.CALL_PHONE"/> <activity

Writing external storage doesn't work until I restart the application on Android M

做~自己de王妃 提交于 2019-11-29 09:09:09
I am having an issue with the new permission system. I modified my code to ask permission for WRITE_EXTERNAL_STORAGE. But my app cannot write to (or read from) the sd card until I restart application (of course I allowed it in the dialog). After that it's working fine. It's not a new app, I already declared WRITE_EXTERNAL_STORAGE in the manifest, and on earlier systems it's working fine. I'm using checkSelfPermission and requestPermissions methods and when I make a read or write request to the sd card I've got an exception that I don't have permission. Anyone has any idea what did I miss? Or

How to ask multiple permissions at same time in Android Marshmelllow

僤鯓⒐⒋嵵緔 提交于 2019-11-29 08:53:10
Following code having multiple permissions, My error is when ever onclick button it asking only one permission, and again i click means it asking another permission. My Onclick public void onClick(View v) { getPermissionCamara(); getStroagePermission(); selectImage(); } My permissions are like this private static final int CAMERA_PERMISSIONS_REQUEST = 1; private static final int STROAGE_PERMISSIONS_REQUEST = 2; public void getPermissionCamara() { if (ContextCompat.checkSelfPermission(this, CAMERA) != PackageManager.PERMISSION_GRANTED) { if (shouldShowRequestPermissionRationale( CAMERA)) { }

Android Custom Permission Fails Based on App Install Order

假如想象 提交于 2019-11-29 08:44:05
问题 Having issues with my apps on Google Play. I have a free app which utilizes a custom permission. This permission allows access to paid apps. These paid apps act as "keys" and unlock features in the free app. Basically the free app will attempt to start the intent of one of the paid apps. The paid app will do some stuff and return saying whether the free app should unlock features or not. Problem arises based on the order of app installation. If the free app is installed first then a paid app,

How to enable screen overlay permission by default

孤街浪徒 提交于 2019-11-29 07:32:40
How can I enable screen overlay permission by default while install application. Now I facing some problem, when capture image asking run time permission some device not allow the permission it open screen overlay settings dialog. at user point of view, they don't know why the dialog showing and what they do. when open the overlay settings screen some of applications automatically enable the screen overlay permission. Below I use the code. if (!Settings.canDrawOverlays(this)) { Intent myIntent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION); startActivityForResult(myIntent, 101); }

Android onRequestPermissionsResult grantResults size > 1

允我心安 提交于 2019-11-29 07:32:25
After requesting permission, the ActivityCompat.OnRequestPermissionsResultCallback sometimes contains multiple grantResults, is it safe to just check the first one? The training doc check the param like this: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { // permission was granted, yay! Do the // contacts-related task you need to do. } else { // permission denied, boo! Disable the // functionality that depends on this permission. } but it's not clearly and no documents found. No, It is not a good way to just check first permission , it might be possible

How to find required Android Marshmallow runtime permissions in code?

廉价感情. 提交于 2019-11-29 07:29:37
I'm preparing my app to target Android 6.0 Marshmallow. When setting the target api to 23, the app immediately crashes upon launch. There is no useful information in the logcat output. (It gives a "Requested window does not exist" IllegalStateException, but still, nothing actually useful like class name or line number.) This is fine (not really), I eventually narrowed it down to my launch activity where I get the user's device IMEI code (TelephonyManager.getDeviceId()). There needs to be a runtime permission request added. I understand this. However, the app has something like 60 classes

Android: Getting image bitmap from third party app (e.g. WhatsApp) via content:// URI

自作多情 提交于 2019-11-29 07:23:05
I am trying to get image from third party app (e.g WhatsApp) to my app (being tested on Marshmallow). When I do "share image" from WhatsApp and share it with my app, I get URI something like this: content://com.whatsapp.provider.media/item/61025 But in my app when I call getContentResolver().openInputStream(uri) or getContentResolver().openFileDescriptor(uri, "r") with above URI, it crashes with exception: java.lang.SecurityException: Permission Denial: opening provider com.whatsapp.MediaProvider from ProcessRecord{a4b804a 30321:com.myapp/u0a145} (pid=30321, uid=10145) that is not exported