android-6.0-marshmallow

AlarmManager not set or not firing on Marshmallow after certain time

只愿长相守 提交于 2019-12-11 12:58:08
问题 I have been successfully using the following construct to start an AlarmManager in some of my apps upto Android 5: Intent serviceIntent = new Intent(context, MyService.class); PendingIntent pi = PendingIntent.getService(context, alarmId, serviceIntent, PendingIntent.FLAG_UPDATE_CURRENT); DateTime inMinutes = (new DateTime()).plusMinutes(60); AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); am.set(AlarmManager.RTC_WAKEUP, inMinutes.getMillis(), pi); But since

Action bar drawer toggle seizes to work with API 23 (appcompat_v7)

落花浮王杯 提交于 2019-12-11 12:48:54
问题 I recently included the appcompat v7 library to my project. In trying to get rid of bunch of errors, I updated most of my SDK files and changed my target SDK version to 23 from 21. The problem is, my old code for designing the Navigation Drawer Toggle (the hamburger sign/arrow sign) now doesn't work and throws and shows errors on the files through eclipse. Here's the code: <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> <item name="spinBars">false</item> <item name

Android M - Camera permission denied returns PERMISSION_GRANTED

 ̄綄美尐妖づ 提交于 2019-12-11 12:48:39
问题 I'm testing denial of permission to an application and I'm seeing that when asking for the state of the permission it returns granted instead of denied. I'm checking state of permissions according to Google's Guide: if (ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { // Should we show an explanation? if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.CAMERA)) { // Show an expanation to

File not found exception when reading external storage

时光怂恿深爱的人放手 提交于 2019-12-11 12:06:29
问题 Earlier the code was working totally fine, and even now it works fine for pre Android 6 devices, but in my Nexus 5, 6.0.1, I am unable to access data from external storage. It shows File not Found Exception java.io.FileNotFoundException: /storage/emulated/0/Download/********/*****: open failed: ENOENT (No such file or directory) For writing the data to storage, I am asking for runtime storage permission and that part seems to be fine. 回答1: Since your code is working fine in Pre-Marshmallow

android:textColor no longer works in Marshmallow

一曲冷凌霜 提交于 2019-12-11 11:10:35
问题 I have written an app which relies on colors defined in resources. Some are set directly in the layout XML file, others are set in code. Examples: Color definition in res/values/styles.xml : <color name="orvGyro">#33B5E5</color> Layout: <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/dotSpace" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/orvGyro" /> Color in code:

Requesting Location Permission at Runtime

巧了我就是萌 提交于 2019-12-11 10:05:57
问题 I have a query implementing RuntimePermission for Location . When I tried to requestLocationUpdates , I got LintError suggesting me to add PermissionCheck for that line. Considering that I implemented run-time permissions. So this is how it looks, if (isNetworkEnabled() && networkListener != null) { if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission

ValueAnimator doesn't work as expected when battery saver is enabled(>= API 21)

橙三吉。 提交于 2019-12-11 08:46:07
问题 ValueAnimator doesn't seem to repeat or play animators that are repeated infinitely when the battery saver is enabled in Android lollipop or higher. animator = ValueAnimator.ofInt(0,timePeriods.length-1); animator.setInterpolator(new LinearInterpolator()); animator.setEvaluator(new TypeEvaluator() { @Override public Object evaluate(float v, Object o, Object t1) { int time = 0 ; int timeElapsed = (int)(v*totalTime) ; for (int i = 0; i < timePeriods.length; i++) { time = time + timePeriods[i];

Marshmallow permission

帅比萌擦擦* 提交于 2019-12-11 06:37:53
问题 I'm trying to check permission in activity as below, int permission = ContextCompat.checkSelfPermission(this, Manifest.permission.GET_ACCOUNT); But I'm getting error at GET_ACCOUNT as Cannot resolve symbol 'GET_ACCOUNT' . Kindly help what code should I add to fix this? Thanks in advance. 回答1: It should be Manifest.permission.GET_ACCOUNTS instead of Manifest.permission.GET_ACCOUNT Try like this int permission = ContextCompat.checkSelfPermission(this,Manifest.permission.GET_ACCOUNTS); Don't

Android 6, authentification issue with BLE Device, access to the LinkKey bits

删除回忆录丶 提交于 2019-12-11 06:25:22
问题 I've got an issue about android 6 and BLE compatibility. My app initiate a read request on a protected characteristic which launch the pairing display to enter the appropriate passcode. With the right pass code, the smartphone and the ble device are bonded just fine if it's with android < 6.0 I tried with an android 6.0.1 too but it keeps giving me the same message "Couldn't pair because of an incorrect PIN or passkey" It's not a permission issue since i already get the position permission

Android TTS(Text to Speech)'s addSpeech() and speak() can't play a sound file in the external storage from marshmallow(api 23) above, with Google TTS

﹥>﹥吖頭↗ 提交于 2019-12-11 06:06:31
问题 As you might know, with addSpeech() in android TTS, you can link a certain text to a sound file. Then, the tts engine plays the file instead of synthesizing the sound of the text. With Google TTS (not Samsung TTS), from Marshmallow(api 23) above, addSpeech & speak can't play a file in the external storage. Before Marshmallow everything was OK. Those who have used android tts and addSpeech, please take a look at the codes below and help me find the problem. The codes were originally from http: