android-6.0-marshmallow

Getting FileNotFoundException on Android app after denying and than granting permission at runtime

青春壹個敷衍的年華 提交于 2019-12-24 02:18:31
问题 I'm trying to to get an app to play an mp3 from the sd card. I'm using the android sdk version 23, with Android studio on Windows 8. I'm running this on the nexus 5 emulator. I'm requesting permission at runtime and I'm getting a FileNotFoundException if I deny the permission once but than grant the permission on the second request. If I restart the app, I'm able to play the music file and if I accept the permission request on the first try it also successfully plays the music without

Android 6 permission - Crashes when toggling permission in Setting and go back to app

白昼怎懂夜的黑 提交于 2019-12-23 22:02:31
问题 The app is running with Marshmallow. With the app open, I switched to " Setting>Apps>MyApp>Permissions " to toggle the permissions and when switching back to the app, it crashes. From the logcat, I found these lines: 01-18 14:45:35.456 799-1158/? I/ActivityManager? Killing 23531:ca.bluecross.ab.sys1/u0a103 (adj 9): permissions revoked 01-18 14:45:35.476 799-1632/? I/WindowState? **WIN DEATH:** Window{20182a4 u0 ca.bluecross.ab.sys1/myexample.com.view.activities.eclaims.AuditActivity} 01-18 14

Blurry image after canvas rotate, only in Android 6

橙三吉。 提交于 2019-12-23 17:31:47
问题 I've got a custom view with the following code: private final Drawable outerGauge; private final Drawable innerGauge; private float rotateX; private float rotateY; private int rotation = 0; { outerGauge = getContext().getDrawable(R.drawable.gauge_outer); innerGauge = getContext().getDrawable(R.drawable.gauge_inner); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); outerGauge.draw(canvas); canvas.rotate(rotation, rotateX, rotateY); innerGauge.draw(canvas); canvas.rotate

scaleGestureDetector.getScaleFactor() always returning 1.0 in Android 6.0

我的未来我决定 提交于 2019-12-23 17:25:14
问题 I am using ScaleGestureDetector to detect pinch out and pinch in actions, by getting the scale factor an if it is less then one then it is zoom out and vise versa. But the problem is that on Android 6.0 the scale factor is always 1.0 which make it impossible to distinguish pinch in from pinch out. Thanks in advance for any help. import android.content.Context; import android.os.Handler; import android.support.v4.view.GestureDetectorCompat; import android.support.v4.view.MotionEventCompat;

Can i skip asking Runtime Permissions on marshmallow?

二次信任 提交于 2019-12-23 15:14:33
问题 Now this is something very interesting for me, I know mostly about Runtime Permissions and i am well aware of why Runtime Permissions proposed? and How we can use it? but in this question which is about a problem rising due to this run time permission thing, A guy proposed a pretty newer way to solve this problem. See U.swap's answer on the same question,here is that answer. This guy Proposed a nice and working solution that user have to approve Permissions only once and for rest of his life

GoogleAccountCredential.setSelectedAccountName(String) not working on Android 6.0 without Contacts permission

牧云@^-^@ 提交于 2019-12-23 12:59:25
问题 I'm retrieving an GoogleAccountCredential object using: GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2( context, Arrays.asList({ GmailScopes.MAIL_GOOGLE_COM })) .setBackOff(new ExponentialBackOff()) .setSelectedAccountName(email) with email being the Gmail account I'm using on the device. If I retrieve the account name using credential.getSelectedAccountName the result is null. This happens only on devices running Android Marshmallow and only if the app does NOT have

getAllNetworkInfo() is deprecated in M but its replacement has difference behavior

不羁的心 提交于 2019-12-23 12:27:47
问题 ConnectivityManager's getAllNetworkInfo() is deprecated on API 23 and the comments for it say to use getAllNetworks() instead. However I am finding these do not have the same behavior. For example, if the phone has an active cellular network available but wifi is currently turned on, then getAllNetworkInfo() will return both networks (it'll show wifi as connected and cellular as disconnected). However getAllNetwork() only returns the wifi network in this situation. If wifi is turned off then

Doze mode handling

戏子无情 提交于 2019-12-23 12:04:03
问题 I am working on an application which spawns some services in the background using AlarmManager. Timing is very crucial to our application and the functionality can't wait for the next maintenance window to occur. Asking a user to white-list the application is not an issue but doesn't fix the issue of suspending alarms. Also battery consumption is not that big of an issue as well. First possible solution that came to my mind was to spawn an always running foreground service to handle the

Detect current running application in Android Nougat 7.+ version

爷,独闯天下 提交于 2019-12-23 08:54:02
问题 Android team changed their approaches to get current running applications from time to time. I am able to get current running applications upto Marshmallow 6.0 version but i want to ask that how can i get these in Nougat 7.0 version? Is there anyway to do that? Please guide towards solutions. I have searched a lot but could find any appropriate way to that. Thanks 回答1: Simple answer: no, you can't. Long answer: you can't get the running process but you can retrospectively see what was running

Android 6 Marshmallow: requests for some specific permissions are instantly denied with no ui shown

喜你入骨 提交于 2019-12-23 07:57:39
问题 Using official AVD rev. 3 Calling this: ActivityCompat.requestPermissions(activity, new String[]{"android.permission.USE_CREDENTIALS"}, REQUEST_PERMISSION_CREDENTIALS); Fires immediately: onRequestPermissionsResult (int requestCode, String[] permissions, int[] grantResults) And resulting code is PackageManager.PERMISSION_DENIED Anyone has a fix? UPDATE: Known to be affected: Manifest.permission.CHANGE_NETWORK_STATE Manifest.permission.WRITE_SETTINGS (solved, see Sam's answer) android