Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用Android共享意向选择器(ACTION\u SEND)收听/捕捉社交媒体共享的成功事件?_Java_Android_Events_Android Intent_Listener - Fatal编程技术网

Java 如何使用Android共享意向选择器(ACTION\u SEND)收听/捕捉社交媒体共享的成功事件?

Java 如何使用Android共享意向选择器(ACTION\u SEND)收听/捕捉社交媒体共享的成功事件?,java,android,events,android-intent,listener,Java,Android,Events,Android Intent,Listener,我正在使用Intent ACTION_SEND在不同的社交媒体上共享内容 现在,抛开twitter、facebook、instagram等其他应用程序不谈,我怎么知道这些股票是否已成功发布?有没有什么倾听者?或者是否有意为其提供结果功能?这是意图代码 public static void shareTo(String type, String mediaPath, String caption, Context context) { Intent share = new Intent

我正在使用Intent ACTION_SEND在不同的社交媒体上共享内容

现在,抛开twitter、facebook、instagram等其他应用程序不谈,我怎么知道这些股票是否已成功发布?有没有什么倾听者?或者是否有意为其提供结果功能?这是意图代码

public static void shareTo(String type, String mediaPath, String caption, Context context) {


    Intent share = new Intent(Intent.ACTION_SEND);


    share.setType(type);


    File media = new File(mediaPath);
    Uri uri = Uri.fromFile(media);


    share.putExtra(Intent.EXTRA_STREAM, uri);
    share.putExtra(Intent.EXTRA_TEXT, caption);


    context.startActivity(Intent.createChooser(share, "Share to"));
}

不,对不起。您没有收到任何关于“发送意向”操作的收件人如何处理该操作的反馈。

没有,抱歉。您没有收到任何关于发送意向的操作的收件人如何处理该操作的反馈。

发送的操作不会返回任何回调,但是下面的一些解决方法非常适合我

int action_type=-1;

shareData()
{
   action_type=1;
}

@Override
protected void onResume() {
    super.onResume();
    if(action_type==1)
    {
        loadInterstitialAd();
        action_type=-1;
    }
}
冷药丸:

ACTION\u SEND不会返回任何回调,但是下面的一些解决方法非常适合我

int action_type=-1;

shareData()
{
   action_type=1;
}

@Override
protected void onResume() {
    super.onResume();
    if(action_type==1)
    {
        loadInterstitialAd();
        action_type=-1;
    }
}

冰镇药丸:

:我想是的,那很可悲。然后,探索每个应用程序的API是剩下的唯一选择:我想是的,这很令人伤心。然后,探索每个应用程序的API是唯一的选择