android-6.0-marshmallow

textView.getSelectionEnd() returning start index value on Samsung Marshmallow 6.0 devices

蹲街弑〆低调 提交于 2019-12-10 02:54:25
问题 This issue is observed on Samsung devices with Android 6.0 only. It is working fine on all other devices, including non - Samsung devices with android 6.0 and Samsung devices with Android 5.1 and below. Currently we don`t have any Samsung device with Android 6.0 to readily check things on it, but we are arranging it soon. The feature where we are using this : The user long presses on a word from a sentence in a TextView and then user can edit the selected word. We accomplish this by : Making

Android 6.0 Write to external SD Card

爱⌒轻易说出口 提交于 2019-12-09 23:13:12
问题 I tried everything to write on external SD card on Android 6.0, but I am not able to write on it. I did research on stackoverflow and found lot of things but none works. Here is my code String extPath = System.getenv("SECONDARY_STORAGE") + "/Android/data/com.gvm.externalstorage.externalstoragetest/"; File file = new File(extPath,"myFiles"); if (!file.exists()) { boolean dirResult = file.mkdirs(); Log.e("Directory Exist", dirResult + " Directory created"); } else { Log.e("Directory Exist",

Prompting for location permission when NOT monitoring in background?

怎甘沉沦 提交于 2019-12-09 16:53:24
问题 I'm using the Android Beacon Library. Since Marshmallow, I am seeing the following error, as expected and documented. Permission denial: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results I have my ranging code in a Fragment, and the RuntimeException is thrown when the Fragment is on screen, as expected as I'm not prompting for permission. If I hit the home button, Pause is called, and I'm unbinding beaconManager, and the exception is no longer thrown, again,

how to fix screen overlay detected programmatically

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 16:01:05
问题 In my app, I ask for permission to access SMS in Android SDK 23 (runtime permission) but the problem is dialog screen overlay showed up and access not granted .i disabled all another apps overlay but nothing changed. I found this link but not helped and the question is how can I fix it programmatically? 回答1: Ok, finally I found the solution, I search all the web and can't find anything useful. The answer is: When you ask for new permission don't ever do something else like showing toast or...

Lacking privileges to access camera service in Android 6.0

元气小坏坏 提交于 2019-12-09 15:08:41
问题 I am using Camera2API in Android 6.0. I was done without error in Android 5.0. However, when I used my code in the Android 6.0, I have a issue. The issue is that sometime I can open the camera successfully and take picture. However, sometime the camera cannot open and it has error java.lang.SecurityException: Lacking privileges to access camera service at android.hardware.camera2.utils.CameraBinderDecorator.throwOnError(CameraBinderDecorator.java:108) I added the runtime permission as follows

Android Location return null after Enabling GPS in dialog

痴心易碎 提交于 2019-12-09 12:11:39
问题 When I enter a screen, I check for if GPS is turned on, if not, the dialog to enable GPS is shown. When user clicks Yes, onActivityResult -> GPS is turned on and I try to get the location but this always returns null When I enter the screen with GPS already on, location is retrieved properly. I have been struggling with this for few days now and can't seem to find any resources. UserLocationUtilities.java public class UserLocationUtilities implements GoogleApiClient.ConnectionCallbacks,

Foreground Service killed on Huawei (GRA-UL00) - Protected Apps Enabled

亡梦爱人 提交于 2019-12-09 09:38:58
问题 My foreground sticky service is killed after a few hours without being restarted. I know this has been asked a couple of times, and I have read and verified all the checks on my device. Its important to note that this seems to occur only on Huawei devices. So allow me to provide the following details. Periodic Service public class PeriodicService extends Service { @Override public void onCreate() { super.onCreate(); acquireWakeLock(); foregroundify(); } private void foregroundify() { //

Google Now gradient/shadow on status bar & navigation bar

主宰稳场 提交于 2019-12-09 09:28:19
问题 I'm trying to make a similar status bar and navigation bar gradient as Google Now. Image Reference: Rectangular area indicated as below After trying the below option on Android Marshmallow, <item name="android:windowTranslucentNavigation">true</item> <item name="android:windowTranslucentStatus">true</item> I get the below behaviour Image Reference: Can anyone suggest me how to get gradient on both these ? Is that a gradient or is that a shadow ? 回答1: It is a gradient being used as a scrim. To

BluetoothLeScanner.startScan with Android 6.0 does not discover devices

旧街凉风 提交于 2019-12-09 07:53:39
问题 I'm trying to use the function BluatoothLeScanner.startScan instead of the deprecated one BluetoothAdapter.startLeScan . Yesterday I updated my Nexus 5 to Android 6.0 and since that moment my app does not work anymore. I firstly add the preferences required ACCESS_COARSE_LOCATION as found here, https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id. Then I added the permission as described here: https://developer.android.com/training/permissions

DatePickerDialog not working as expected

痴心易碎 提交于 2019-12-09 06:03:25
I have an EditView in which I am trying to bind DatePickerDialog . Its working well with the api 19 . but when tested on api version 25 Marshmallow the calendar becomes white and when selected some date the EditView is not populated as well i.e I am unable to set date in Marshmallow . Code: warrantyExpEt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { new DatePickerDialog(getContext(), date, myCalendar .get(Calendar.YEAR), myCalendar.get(Calendar.MONTH), myCalendar.get(Calendar.DAY_OF_MONTH)).show(); } }); final DatePickerDialog.OnDateSetListener date