apollo9
apollo9

Reputation: 131

Prevent auto choose which sharing application use

I'm develop an application in Android.

I have a ListView with some image, when I click a row I open ContextMenu and I have two choices, eliminate the image or sharing with other application.

    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_SEND);
    intent.setType("image/*");
    Uri r = Util.getImageUri(getActivity().getApplication(), image);
    intent.putExtra(Intent.EXTRA_STREAM, r);
    startActivity(intent);

I use this code to sharing the image, but after the first time, every time that I try to share image, the application always chooses the first application with which I sent the first image.

How can I prevent it? I want that user chooses every time the sharing application. Thanks.

Upvotes: 0

Views: 378

Answers (2)

CommonsWare
CommonsWare

Reputation: 1007296

I use this code to sharing the image, but after the first time, every time that I try to share image, the application choose always the first application with wich I send the first image.

That was because you indicated, to the chooser, that you wanted to make this choice "always", instead of "just once".

I want that user choose every time sharing application

Use:

startActivity(Intent.createChooser(intent, "..."));

where "..." is your explanation for this.

Upvotes: 2

Shivam
Shivam

Reputation: 532

In your phone go to settings-->Apps then select the app which get opens by default then there you will find an option "Open by default" open that option, in there press "Clear Defaults".

Then in your app again you will get the list of application to share with

Upvotes: 0

Related Questions