I have a feature in my application that allows people to share content.
It usually works:
The device asks the user to select an application for processing Intent
. The user can choose between โonly onceโ or โalwaysโ.
On some Samsung devices, for example. Galaxy S6, the options "only once" and "always" are absent, after selecting an application, this application becomes the standard for this event.
This even leads to the fact that my application has just been installed, when I try to share, the user does not ask at all, Intent
simply processed by the application that the user chose to share when sharing with another application!
This issue with some Samsung devices is documented here and here .
This is how I build my simple intention:
Intent intent = ShareCompat.IntentBuilder.from(this) .setSubject("mySubject") .setText("myText") .setType("text/plain") .setChooserTitle("myChooserTitle").getIntent(); startActivity(intent);
I also tried:
Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, "myText"); sendIntent.putExtra(Intent.EXTRA_SUBJECT, "mySubject"); sendIntent.setType("text/plain"); startActivity(sendIntent);
My question is: Can I do something from my code to prevent this , or should I tell my users not to buy Samsung next time?
source share