Questions tagged [android-intent-chooser]

An Intent to choose from different app options to resolve your request.

Example of usage:

Intent intent = new Intent(Intent.ACTION_SEND);

// Always use string resources for UI text.
// This says something like "Share this photo with"
String title = getResources().getString(R.string.chooser_title);
// Create intent to show chooser
Intent chooser = Intent.createChooser(intent, title);

// Verify the intent will resolve to at least one activity
if (intent.resolveActivity(getPackageManager()) != null) {
    startActivity(chooser);
}

Reference to Android page

111 questions
156
votes
16 answers

Allow user to select camera or gallery for image

What I'm trying to do seems very simple, but after a few days of searching I can't quite figure it out. I have an application that allows the user to select multiple(up to 5) images. I'm using an ImageView. When the user clicks on the ImageView,…
37
votes
4 answers

Android 11 (R) return empty list when querying intent for ACTION_IMAGE_CAPTURE

Device: Emulator pixel 3a - Android 11 Code: final List cameraIntents = new ArrayList(); final Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); final List listCam = …
13
votes
2 answers

Providing icon to system chooser via ChooserTargetService, FileProvider and grantUriPermission

I have some images stored in local app connected with certain contexts (like contacts). I'm using direct share (API 23+) via ChooserTargetService to show these to choose from and I want to ChooserTarget instances to have Icon filled with these…
8
votes
2 answers

Choosing between camera and gallery for image selection

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/*"); …
7
votes
1 answer

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

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…
MikeL
  • 2,756
  • 2
  • 23
  • 41
7
votes
1 answer

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

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…
7
votes
2 answers

Android: PDF files hidden despite setting the MIME type

This is my Intent: Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("text/* , application/pdf, image/*"); But, when the file explorer shows up, the PDF files are grayed out i.e., un-choosable. Is there any workaround for this?
7
votes
2 answers

My app won't show up on the chooser dialog for android.intent.action.VIEW with mime type video/* only on Marshmallow

Basically when an app shares a video url my app is supposed to show up on the list but it doesn't. Neither does MXPlayer but the Google Photos media player shows up fine as well as allcast (which had a recent release to fix this). I wrote a quick…
6
votes
1 answer

How to mimic a chooser activity/share menu?

I have tried to make my own Chooser Activity to replace androids share to... popup. I took a look at ChooserActivity extends ResolverActivity and tried to copy the code. In my manifest I have
6
votes
1 answer

Is there an event when user cancels intent chooser?

In my android application I want the user to choose, which other application should be used to display a certain image if there are more than one possible apps. Therefore I got following code: final Intent intent = new Intent(Intent.ACTION_VIEW) …
c7n
  • 1,131
  • 16
  • 29
6
votes
0 answers

Ignore specific Urls from Intent filter

How to ignore specific set of URLs from Intent Filter. Existing filter.
VenomVendor
  • 15,064
  • 13
  • 65
  • 96
5
votes
1 answer

How to share different texts based on package name in Android 10?

My app shares a specific URL to open in other apps, but I want to use a custom URL depending on what app the user is sharing it with. For example, with Gmail I want to use myurl.com?src=gmail, and with FB I want to use myurl.com?src=fb etc. This…
BeLambda
  • 887
  • 1
  • 10
  • 19
5
votes
0 answers

How to use android directory chooser from a specified directory path

I am new to android and learning it, what I want is to choose folder/directory from a specified path like in my case path will be sd-card/DMM/DT, I want that directory chooser start from this folder not from generic location. I am using this code…
Irshad Babar
  • 1,311
  • 19
  • 26
5
votes
1 answer

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

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…
REJH
  • 3,273
  • 5
  • 31
  • 56
5
votes
4 answers
1
2 3 4 5 6 7 8