android-permissions

Android M detect if permission dialog is visible

ぐ巨炮叔叔 提交于 2020-02-21 10:50:29
问题 How can I determine programmatically if a permission dialog is visible to the user so I know what to do in this case? 回答1: @Override protected void onStart() { super.onStart(); ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ComponentName cn = am.getRunningTasks(1).get(0).topActivity; if ("com.android.packageinstaller.permission.ui.GrantPermissionsActivity".equals(cn.getClassName())){ //permission dialog is displayed } }` ` 回答2: Permission dialog is an

Android M detect if permission dialog is visible

烂漫一生 提交于 2020-02-21 10:50:06
问题 How can I determine programmatically if a permission dialog is visible to the user so I know what to do in this case? 回答1: @Override protected void onStart() { super.onStart(); ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ComponentName cn = am.getRunningTasks(1).get(0).topActivity; if ("com.android.packageinstaller.permission.ui.GrantPermissionsActivity".equals(cn.getClassName())){ //permission dialog is displayed } }` ` 回答2: Permission dialog is an

Android M detect if permission dialog is visible

妖精的绣舞 提交于 2020-02-21 10:49:08
问题 How can I determine programmatically if a permission dialog is visible to the user so I know what to do in this case? 回答1: @Override protected void onStart() { super.onStart(); ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ComponentName cn = am.getRunningTasks(1).get(0).topActivity; if ("com.android.packageinstaller.permission.ui.GrantPermissionsActivity".equals(cn.getClassName())){ //permission dialog is displayed } }` ` 回答2: Permission dialog is an

Read and Write external storage permission isn't working

落爺英雄遲暮 提交于 2020-02-18 21:13:47
问题 In my app i want to get user permission to read and write data on external storage, i have put permission tag in my manifest as below. But when installing app or running and where it requires to read or write to storage no permission is taken from user and reading and writing memory just doesn't work, until i manually go to setting-app-access and enable access to memory. My manifest is this: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res

Read and Write external storage permission isn't working

你。 提交于 2020-02-18 21:12:13
问题 In my app i want to get user permission to read and write data on external storage, i have put permission tag in my manifest as below. But when installing app or running and where it requires to read or write to storage no permission is taken from user and reading and writing memory just doesn't work, until i manually go to setting-app-access and enable access to memory. My manifest is this: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res

error: incompatible types: int cannot be converted to String

余生长醉 提交于 2020-02-08 10:39:48
问题 In the below code it shows error in ActivityCompat.requestPermissions(this, new String [] {Manifest.permission.SEND_SMS, PackageManager.PERMISSION_GRANTED}); and ActivityCompat.requestPermissions(this, new String [] {Manifest.permission.INTERNET, PackageManager.PERMISSION_GRANTED}); package com.example.myapplication; import androidx.core.app.ActivityCompat; import androidx.fragment.app.FragmentActivity; import android.Manifest; import android.content.pm.PackageManager; import android.location

Permissions for Voice search

喜你入骨 提交于 2020-02-03 04:19:47
问题 Running Google Voice Search on my ICS (Android 4.0.4) tablet yields strange behavior with the following warnings: W/PackageManager( 1571): Unknown permission com.google.android.voicesearch.SHORTCUTS_ACCESS in package com.google.android.googlequicksearchbox W/PackageManager( 1571): Unknown permission com.google.android.voicesearch.AUDIO_FILE_ACCESS in package com.google.android.gm W/RecognitionManagerService( 1571): no available voice recognition services found I/ActivityManager( 1571): Start

Camera on Xamarin WebView

倾然丶 夕夏残阳落幕 提交于 2020-02-01 08:59:31
问题 I have a simple Xamarin Page with a WebView that calls a WebRTC test page: _webView = new WebView { Source = "https://test.webrtc.org/", WidthRequest = 1000, HeightRequest = 1000 }; var stackLayout = new StackLayout() { Orientation = StackOrientation.Vertical, Padding = new Thickness(5, 20, 5, 10), Children = { _webView } }; Content = new StackLayout { Children = { stackLayout } }; The https://test.webrtc.org/ page works fine on Chrome on the same Android Emulator, but don't work on WebView

Xamarin.Android app doesn't request “WriteExternalStorage” (but code works fine with “ReadExternalStorage”)

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-25 10:09:31
问题 I already have some experiences with C#, but I'm new to Android-Development and wanted to start with a simple project app, that can create a new directory with a file on the external storage ("/storage/emulated/0/" [Android.OS.Environment.ExternalStorageDirectory.AbsolutePath]) and read it. In the documentation I read that in the newer SDKs it's not enough to mention the permissions (in this case "ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE") in the AndroidManifest.xml. So I added a method to

Anyone knows where is “start in background” permission in MIUI 11?

旧城冷巷雨未停 提交于 2020-01-24 19:05:12
问题 I'm not able to start activity in MIUI 11 redmi note 6 pro mobile, I am getting error as: com.android.server.am.ExtraActivityManagerService: MIUILOG- Permission Denied Activity I found some solution like turn on "start in background" permission. I can't find something like this with MIUI 11. Literally I have no idea about this issue. Thanks in advance. 回答1: I have a similar problem with starting activity from BroadcastReceiver when application is stopped. 1) You can find your app in the