Questions tagged [android-6.0-marshmallow]

Android Marshmallow, formerly known as just "Android M", is version 6.0 of Android, is supporting API Level 23, and began shipping in October 2015.

Android Marshmallow, formerly known as just "Android M", is version 6.0 of Android, and began shipping in October 2015.

It was first shown at Google I/O 2015, with the final name confirmed on August 17th.

All API changes

Here is a summary of the major API-changes:

  • Runtime Permissions
  • Power-Saving Optimizations
  • Adoptable Storage Devices
  • Apache HTTP Client Removal
  • AudioManager Changes
  • Notifications
  • Text Selection
  • Android Keystore Changes
  • Wi-Fi and Networking Changes
  • Camera Service Changes
  • Runtime
  • Access to Hardware Identifier
  • APK Validation
  • USB Connection
  • Android for Work Changes

Official:

2168 questions
785
votes
14 answers

getColor(int id) deprecated on Android 6.0 Marshmallow (API 23)

The Resources.getColor(int id) method has been deprecated. @ColorInt @Deprecated public int getColor(@ColorRes int id) throws NotFoundException { return getColor(id, null); } What should I do?
araks
  • 40,738
  • 8
  • 34
  • 39
448
votes
15 answers

How can I programmatically open the permission screen for a specific app on Android 6.0 (Marshmallow)?

I have a question regarding the new Android 6.0 (Marshmallow) release. Is it possible to display the "App Permissions" screen for a specific app via an Intent or something similar? It is possible to display the app's "App Info" screen in Settings…
372
votes
29 answers

Android M - check runtime permission - how to determine if the user checked "Never ask again"?

According to this: http://developer.android.com/preview/features/runtime-permissions.html#coding an app can check for runtime permissions and request permissions if it hasn't been granted already. The following dialog will be displayed then: In…
Emanuel Moecklin
  • 28,488
  • 11
  • 69
  • 85
287
votes
10 answers

An Android app remembers its data after uninstall and reinstall

While developing an Android app targeting all versions above 4.1, I observed that uninstalling my app and installing it again does not clear its data. The app is designed to store the details that it asks in its first screen. After uninstalling…
Narayanan
  • 3,736
  • 2
  • 19
  • 24
234
votes
17 answers

onRequestPermissionsResult not being called in fragment if defined in both fragment and activity

I have a fragment in which I have recyclerview and setting data in this recyclerview using recyclerview adapter. Now, I am having a button in the adapter's list item clicking on which I need to check the READ_EXTERNAL_STORAGE permission in android…
Prithniraj Nicyone
  • 5,021
  • 13
  • 52
  • 78
212
votes
13 answers

Android M Permissions : Confused on the usage of shouldShowRequestPermissionRationale() function

I was going through the official doc about the new Permissions model in Android M. It talks about the shouldShowRequestPermissionRationale() function which returns true if the app has requested this permission previously and the user denied the…
akshayt23
  • 2,793
  • 3
  • 21
  • 29
202
votes
26 answers

Android marshmallow request permission?

I am currently working on an application that requires several "dangerous" permissions. So I tried adding "ask for permission" as required in Android Marshmallow(API Level 23), but couldn't find how to do it. How can I ask for permission using new…
Nilabja
  • 4,206
  • 5
  • 27
  • 45
195
votes
23 answers

Android 6.0 multiple permissions

I know that Android 6.0 has new permissions and I know I can call them with something like this if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { …
187
votes
12 answers

Storage permission error in Marshmallow

In Lollipop, the download functionality works fine in my app, but when I upgraded to Marshmallow, my app crashes and gives this error when I try to download from the internet into the SD card: Neither user nor current process has…
fullmoon
  • 8,030
  • 5
  • 43
  • 58
179
votes
28 answers

ConnectivityManager getNetworkInfo(int) deprecated

Using compileSdkVersion 23, however trying to support as far back as 9. getNetworkInfo(int) was deprecated in 23. The suggestion was to use getAllNetworks() and getNetworkInfo(Network) instead. However both of these require minimum of API 21. Is…
121
votes
10 answers

Location needs to be enabled for Bluetooth Low Energy Scanning on Android 6.0

After upgrading to Android version 6.0 Bluetooth Low Energy (BLE) scanning will only work if Location services are enabled on the device. See here for reference: Bluetooth Low Energy startScan on Android 6.0 does not find devices Basically, you need…
V-PTR
  • 3,183
  • 3
  • 20
  • 21
117
votes
12 answers

Any way to link to the Android notification settings for my app?

Is there any way I can launch an intent to get to Android's notification settings screen for my app (pictured below)? Or an easy way I can make a PreferenceScreen item that just leads here on a click?
Mohamed Hafez
  • 8,621
  • 7
  • 41
  • 49
109
votes
7 answers

Android 5.1.1 and above - getRunningAppProcesses() returns my application package only

It seems Google finally closed all doors for getting the current foreground application package. After the Lollipop update, which killed getRunningTasks(int maxNum) and thanks to this answer, I used this code to get the foreground application…
Lior Iluz
  • 26,213
  • 16
  • 65
  • 114
108
votes
5 answers

How to request permissions from a Service in Android Marshmallow

In Android Marshmallow, permissions should be requested at runtime when they are needed, instead of all at once when an app is installed. However, I can only seem to request permissions from an Activity, which is a problem since my app contains only…
101
votes
26 answers

Status bar turns white and does not show content behind it

I am trying out AppCompat on Marshmallow. And I want to have a transparent status bar however it turns white. I've tried a couple solutions but they didn't work for me (Transparent status bar not working with windowTranslucentNavigation="false",…
1
2 3
99 100