android-6.0-marshmallow

Send email through Intent : SecurityException

旧时模样 提交于 2019-12-30 10:13:50
问题 Here is how I'm sending email through Gmail App. Intent emailIntent = new Intent(Intent.ACTION_SEND); emailIntent.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail"); emailIntent.setType("text/html"); emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Puzzle"); emailIntent.putExtra(Intent.EXTRA_TEXT, someTextHere)); emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(attachmentFile)); try { startActivityForResult(emailIntent, SHARE_PUZZLE_REQUEST_CODE); } catch

Not all permissions in ACCOUNT permission group granted automatically

浪尽此生 提交于 2019-12-30 09:59:55
问题 In my app, I need the following permissions for creating an account: <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/> <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/> <uses-permission android:name="android.permission.USE_CREDENTIALS"/> It is my understanding that in the M, these should be granted automatically. However, what I'm seeing is that only GET_ACCOUNTS is granted. I've

FIleObserver and ContentObserver not working in Android Marshmallow

老子叫甜甜 提交于 2019-12-30 08:23:11
问题 I have issue with both FIleObserver and ContentObserver not working in Android Marshmallow. I am using this thing for detecting changes that happening inside a folder. I set run time permissions for marshmallow. But after that also it shows no events. It works perfectly in other versions. Please help me to solve this problem. First I tried Content Resolver inside Service for detect folder changes in background. public class TestService extends Service { @Override public void onCreate() {

Marshmallow Fingerprint Scanner Hardware Presence

落花浮王杯 提交于 2019-12-30 06:51:12
问题 I am looking to get started with the Marshmallow Fingerprint Authentication API. I understand that to ask for permission, I must use the following method: ContextCompat.checkSelfPermission(getContext(), Manifest.permission.USE_FINGERPRINT); And I must check if the device is running API level 23 or higher. But before I ask for permission, I would like to check if the device actually has a fingerprint scanner to begin with. I found the following two methods to do this check: FingerprintManager

RecyclerView inside ScrollView, some items are not shown

Deadly 提交于 2019-12-30 05:46:08
问题 I had a RecyclerView in ScrollView like this: <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <!--other stuff--> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone"/> </LinearLayout> <!--other stuff--> </ScrollView> And the RecyclerView 's item is a RelativeLayout , inside of which

How to check for Mock Location in Android Marshmallow?

…衆ロ難τιáo~ 提交于 2019-12-29 04:47:27
问题 How to detect if the location is triggered with Mock Location in Android Marshmallow ? Previously, I used Settings.Secure.ALLOW_MOCK_LOCATION But, in API level 23, this has been deprecated. I want to check if the trigger is with Fake location or original GPS ? Now, what is the alternative to check if Mock Location is enabled or not Android Marshmallow ? 回答1: If you are using FusedLocationProviderApi and have set mock location using setMockLocation(mGoogleApiClient, fakeLocation); in the

Security Exception only on Android 6

帅比萌擦擦* 提交于 2019-12-29 04:18:07
问题 java.lang.SecurityException: Client must have ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to perform any location operations. The app works fine for Android version 5(Lollipop) but gets a Security Exception on the Android version 6. 回答1: On your activity: private static final int REQUEST_FINE_LOCATION=0 ... loadPermissions(Manifest.permission.ACCESS_FINE_LOCATION,REQUEST_FINE_LOCATION); Implementation: private void loadPermissions(String perm,int requestCode) { if (ContextCompat

Android Marshmallow Callback when user revokes permissions from settings ?

百般思念 提交于 2019-12-28 15:22:21
问题 Is there a way to get callbacks if the user revokes permissions from the settings after having granted them? I know we have to check for permissions before trying to use a camera etc etc. Consider the following scenario, I have a video processing application which needs permission to read and write to storage. The task of processing is usually in the order of seconds. Assuming the user gave permissions when asked and revokes them after the processing starts. In this case is there a way we can

Since marshmallow update Bluetooth discovery using BluetoothAdapter.getDefaultAdapter().startDiscovery(); is broken

喜欢而已 提交于 2019-12-28 04:23:11
问题 I have an app using bluetooth and connecting to devices, can'f find any devices using BluetoothAdapter.getDefaultAdapter().startDiscovery(); It worked fine just before discovery. Tried also other apps, it doesn't work in other apps as well. But the device I try to pair (Arduino bt-module) can be found in Android settings. Any idea what could I try? I implemented everything like described on http://developer.android.com/guide/topics/connectivity/bluetooth.html and it worked before the update.

How app can access files on USB OTG storages in Android 6.0 (API level 23) without root?

北战南征 提交于 2019-12-28 04:01:27
问题 Android 6.0 Developer Preview (API level 23) can natively mounts external removable USB OTG storages out-of-the-box without any additional apps (for more info please see: https://www.androidpolice.com/2015/05/28/android-m-feature-spotlight-external-storage-can-be-adopted-as-true-internal-storage-or-accessed-normally-with-no-additional-apps/). When user connects USB OTG storage, it shows up in the system storage menu and it is accessible with the built-in file manager. User can access all