Android 从通知发送操作\发送意图

Android 从通知发送操作\发送意图,android,android-intent,android-notifications,Android,Android Intent,Android Notifications,我正在尝试发送和Intent.ACTION\u单击通知后发送。这就是我所做的 public static void generateNotification(Context context, String title, String message) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE

我正在尝试发送和Intent.ACTION\u单击通知后发送。这就是我所做的

public static void generateNotification(Context context, String title, String message)
{ 
    NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

    Builder notificationBuilder = new Notification.Builder(context)
                                        .setContentTitle(title)
                                        .setContentText(message)
                                        .setSmallIcon(R.drawable.ic_launcher)
                                        .setWhen(System.currentTimeMillis());

    Intent shareIntent = new Intent(Intent.ACTION_SEND);    
    String extraText = title + " has " + message;
    shareIntent.putExtra(Intent.EXTRA_TEXT, extraText);
    PendingIntent pendingShareIntent = PendingIntent.getActivity(context, 0, Intent.createChooser(shareIntent, "share..."),
                                                                PendingIntent.FLAG_UPDATE_CURRENT);

    notificationBuilder.addAction(android.R.drawable.ic_menu_share, "share...", pendingShareIntent);

    Notification bigTextNotification = new Notification.BigTextStyle(notificationBuilder)
                                        .setBigContentTitle(title)
                                        .bigText(message)
                                        .build();

    notificationManager.notify(tag, notificationId++, bigTextNotification);
}
我收到通知上的共享操作,但当我单击它时,会显示一个对话框

没有应用程序可以执行此操作

当我通过startActivity()运行相同的intent时,效果很好


有人能帮我一下吗?

您未能使用
setType()
Intent
上指定MIME类型。尝试添加它,看看是否有帮助。

我知道我有点劫持它,但我正在寻找一个应用程序或某种实用程序,让您共享下载通知中下载的图像。Imgur在其应用程序中的股票期权只共享一个指向该图像的链接,但我想将该图像嵌入我的聊天室。目前,我必须下载图像,打开我的文件浏览器,在其他图像列表中找到名称奇怪的文件,从那里选择共享,选择Hangouts,然后点击send。这个问题似乎是唯一与我在谷歌上想要什么密切相关的问题。我问错谷歌的问题了吗?