Use intent chooser when sharing

This commit is contained in:
seven332 committed 2018-06-05 21:03:59 +08:00
1 parent 6af75a9758
commit f870674bd2
1 file changed
+2 -1
@@ -58,9 +58,10 @@ public class AppHelper {
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, text);
sendIntent.setType("text/plain");
Intent chooser = Intent.createChooser(sendIntent, from.getString(R.string.share));
try {
from.startActivity(sendIntent);
from.startActivity(chooser);
return true;
} catch (ActivityNotFoundException e) {
Toast.makeText(from, R.string.error_cant_find_activity, Toast.LENGTH_SHORT).show();