Android Intents:接收文本数据而不显示接收活动

时间:2016-09-01 06:03:31

标签: java android android-intent android-sharing

我注意到在尝试与其他应用分享文字并选择Facebook进行保存时,Facebook的接收活动无法打开(至少它可能很快),它只显示一个吐司确认信息。

这就是我尝试的方式

private void welcomeSharedData(){
        Intent intent       = getIntent();
        String action       = intent.getAction();
        String type         = intent.getType();

        if (Intent.ACTION_SEND.equals(action) && type != null) {
            if ("text/plain".equals(type)) {
                handleSendText(intent);
                saveTextAsNote();
                toastMessage();
                finish();
            }
        }
    }

我的问题是,我的应用程序显示活动的闪烁屏幕然后返回到呼叫应用程序。

我希望它保持安静,只能在祝酒词上回复确认信息。

0 个答案:

没有答案