android-intent-chooser

BroadcastReceiver is not called after createChooser(context,intent,IntentSender) is executed

早过忘川 提交于 2019-12-10 14:13:55
问题 I want to detect what app the user selects after I present him with a createChooser() dialog. So I have created my BroadcastReceiver subclass like this: import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class ShareBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.d("INFORMATION", "Received intent after selection: "+intent.getExtras().toString

Request Permission after selected option(either camera or gallery) from intent chooser in android

拥有回忆 提交于 2019-12-05 10:38:06
问题 I have created an intent chooser containing Gallery, Photos and Camera apps. Now for the devices running on Android 6.0 or greater I want to ask the run time permissions after app is selected from chooser like if user selects gallery option I will ask storage permission only and in case if user select camera option I will ask camera and storage both permissions if not given before. Can someone help me to do so? Here is my code public void openImageIntent() { File storageDir = Environment

Custom chooser activity: SecurityException UID n does not have permission to content:// uri

拥有回忆 提交于 2019-12-04 11:07:04
I'm building a Chooser app that replaces the native Android Share dialog. It works fine except when I try to share an image from Chrome via longpress image > share image. I found that Google+ doesn't catch the exception (it crashes) so I can have a look at it via Logcat: Do an image search on Google. Select an image (this should show the preview) Longpress the image Choose "Share image" My chooser activity pops up Select Google+ Google+ crashes with this error: java.lang.SecurityException: UID 10130 does not have permission to content://com.android.chrome.FileProvider/images/screenshot

Request Permission after selected option(either camera or gallery) from intent chooser in android

余生颓废 提交于 2019-12-03 23:12:29
I have created an intent chooser containing Gallery, Photos and Camera apps. Now for the devices running on Android 6.0 or greater I want to ask the run time permissions after app is selected from chooser like if user selects gallery option I will ask storage permission only and in case if user select camera option I will ask camera and storage both permissions if not given before. Can someone help me to do so? Here is my code public void openImageIntent() { File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); String timeStamp = new SimpleDateFormat(

Custom intent-chooser - why on Android 6 does it show empty cells?

孤街醉人 提交于 2019-12-03 22:38:55
问题 Background I wish to show the native intent-chooser, while having the ability to customize it a bit. For this, I've found the next StackOverflow thread: How to customize share intent in Android? The problem Thing is, when I use the suggested code on Android 5.x and below, everything seems to be fine, but when I use it on Android 6.0.1 (tested on Nexus 5 and emulator, when having multiple apps to share content with) , I get empty cells and sometimes even empty app names, as such: This doesn't

Ignore specific Urls from Intent filter

喜你入骨 提交于 2019-12-01 23:29:45
问题 How to ignore specific set of URLs from Intent Filter. Existing filter. <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="www.example.com" android:scheme="http" /> <data android:host="www.example.com" android:scheme="https" /> <data android:host="example.com" android:scheme="http" /> <data android:host=

Navigation with Waze and Google Maps using Intent.createChooser shows Waze icon twice

时间秒杀一切 提交于 2019-12-01 17:48:51
I'm creating this question after finding the answer, I was not sure about the etiquette, but it seems to be OK (plus, I see now there's a built-in option). The problem was as described in the title, we created an intent chooser using code that resembles this: String url = "waze://?ll=" + latitude + ", " + longitude + "&navigate=yes"; Intent intentWaze = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); String uriGoogle = "google.navigation:q=" + latitude + "," + longitude; Intent intentGoogleNav = new Intent(Intent.ACTION_VIEW, Uri.parse(uriGoogle)); String title = context.getString(R.string

Custom intent-chooser - why on Android 6 does it show empty cells?

瘦欲@ 提交于 2019-12-01 01:53:06
Background I wish to show the native intent-chooser, while having the ability to customize it a bit. For this, I've found the next StackOverflow thread: How to customize share intent in Android? The problem Thing is, when I use the suggested code on Android 5.x and below, everything seems to be fine, but when I use it on Android 6.0.1 (tested on Nexus 5 and emulator, when having multiple apps to share content with) , I get empty cells and sometimes even empty app names, as such: This doesn't appear when using the non-customized intent-chooser: startActivity(Intent.createChooser(intent,

Choosing between camera and gallery for image selection

為{幸葍}努か 提交于 2019-11-27 20:54:58
I am trying to allow a user to select an image, either from the gallery or by taking a picture with the camera. I tried this: Intent imageIntent = new Intent(Intent.ACTION_GET_CONTENT); imageIntent.setType("image/*"); startActivityForResult(Intent.createChooser(imageIntent, "Select Picture"), GET_IMAGE_REQUEST); but it automatically displays the gallery without even providing an option to choose an activity. It seems like there should be some better way to accomplish this than the solution given in this question . Is that really the only way do it? You should do this logic within your app.

Choosing between camera and gallery for image selection

徘徊边缘 提交于 2019-11-26 20:32:29
问题 I am trying to allow a user to select an image, either from the gallery or by taking a picture with the camera. I tried this: Intent imageIntent = new Intent(Intent.ACTION_GET_CONTENT); imageIntent.setType("image/*"); startActivityForResult(Intent.createChooser(imageIntent, "Select Picture"), GET_IMAGE_REQUEST); but it automatically displays the gallery without even providing an option to choose an activity. It seems like there should be some better way to accomplish this than the solution