【问题标题】:Alter the "Complete action using" dialog更改“使用完成操作”对话框
【发布时间】:2023-03-10 10:01:01
【问题描述】:

我正在编写一个应用程序来发送带有图像文件的彩信。我写了以下代码

Intent i = new Intent(Intent.ACTION_SEND);
        String sendfilepath = "file://" + sendfile.toString() + ".jpg";
        i.putExtra(Intent.EXTRA_STREAM,Uri.parse(sendfilepath)) ;
        i.setType("image/jpeg");
        startActivityForResult(i, 1) ;

但是,该应用会显示“使用完成操作”对话框,以便从蓝牙、电子邮件、Facebook、Gmail、Handcent SMS、消息传递、在设备上播放等多种内容中进行选择。

我想只显示与发送 SMS 或 MMS(如消息和 Handcent SMS)相关的内容的对话框。我不想显示所有其他应用程序。我该怎么做?

【问题讨论】:

    标签: android android-intent sms intentfilter


    【解决方案1】:

    如果您尝试让用户向其发送消息的特定电话号码,请使用 ACTION_SENDTOsmsto: Uri 作为您要向其发送消息的电话号码。这绝对适用于短信;我认为它适用于彩信,但我没有尝试过。

    否则,你想要的不是一个好主意。您的用户可能希望通过任意数量的机制共享他们的数据,其中一些不会是彩信应用程序。 Please let the users choose how to share their data.

    【讨论】:

      猜你喜欢
      • 2011-05-23
      • 1970-01-01
      • 1970-01-01
      • 2016-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多