background
many times, we want to allow the user to share something in Android applications.
this can be done using the following function:
public static Intent prepareSharingIntent() { final List<Intent> targetedShareIntents = new ArrayList<Intent>(); final Intent shareIntent = new Intent(Intent.ACTION_SEND); final Intent smsIntent = new Intent(Intent.ACTION_VIEW); targetedShareIntents.add(smsIntent); shareIntent.setType("text/plain"); smsIntent.setType("vnd.android-dir/mms-sms"); final String invitationMessage = "check out my App!"; smsIntent.putExtra(Intent.EXTRA_TEXT, invitationMessage); shareIntent.putExtra(Intent.EXTRA_TEXT, invitationMessage); shareIntent.putExtra("sms_body", invitationMessage); smsIntent.putExtra("sms_body", invitationMessage); shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Check out this app!"); smsIntent.putExtra(Intent.EXTRA_SUBJECT, "Check out this app!"); shareIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedShareIntents.toArray(new Parcelable[] {})); final Intent chooserIntent = Intent.createChooser(shareIntent, "Share using..."); chooserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); return chooserIntent; }
Problem
some users (like me) have many applications that can handle sharing intentions.
this means that sometimes there is a big delay (maybe a second or even more in some cases) from the moment I click to share something, while the dialog is displayed, so this is a rather undesirable behavior.
I have my patience, but maybe some users will think that the application is βlaggyβ because of this.
In fact, I noticed that this problem occurs in many applications (including the application for the play store). the user does not receive feedback that the device is currently doing something to display a dialog.
Question
what can be done to make it more fluid or at least show some kind of dialogue of progress until a real dialogue appears?
source share