安卓:同时共享文本型数据给外部应用程序选择器对话框跳过对话框、跳过、应用程序、文本

2023-09-06 23:58:07 作者:爱情,请稍候...

任何理由外部共享文本/纯键入数据时的Andr​​oid跳过选择对话框(如下图),并直接转到一个特定的应用程序(如WhatsApp的)

它的工作原理以及在图像/ JPEG 类型的数据,而这个问题只是在某些设备发生了。

 字符串份额= Html.fromHtml(node.getString(MSG))的toString()。意图int​​ent2 =新意图(Intent.ACTION_SEND);intent2.setType(text / plain的);intent2.putExtra(Intent.EXTRA_TEXT,共享);startActivity(Intent.createChooser(intent2,getResources()的getString(R.string.SendTo))。); 

解决方案

有两种可能性:这里只有一个应用程序可以处理text / plain的您的手机上,或者你选择一个应用程序作为默认的应用程序来处理类型意图的。如果是第二种情况,你可以到该应用程序的系统设置为默认清

Excel 2016怎么输入文本型数据

Any reason android skip the chooser dialog(as screenshot below) and direct go to one specific app(e.g. WhatsApp) when sharing a text/plain type data externally?

It works well in image/jpeg type of data, and this issue only happens in certain device.

String share = Html.fromHtml(node.getString("Msg")).toString();
Intent intent2 = new Intent(Intent.ACTION_SEND);
intent2.setType("text/plain");
intent2.putExtra(Intent.EXTRA_TEXT, share);
startActivity(Intent.createChooser(intent2, getResources().getString(R.string.SendTo)));

解决方案

There are two possibilities: there's only one app that can handle "text/plain" on your phone, or you selected an app as the default app to handle that type of intents. If it's the second case, you can go to system settings of that app to "clear defaults"