如何共享Web应用程序与Facebook,微博等应用程序、Web、Facebook

2023-09-04 10:35:56 作者:只剩余生

我做新闻applicaion在Android中使用RSS提要,现在我想分享一些新闻也就是我要上传从我的应用程序的Facebook链接,微博etc.Is这可能吗? 谢谢

i made news applicaion in android using RSS feed and now i want to share some news ie i want to upload links from my app to facebook, twitter etc.Is it possible? Thanks

推荐答案

试试这个:

findViewById(R.id.btnEnvoyer).setOnClickListener(
            new Button.OnClickListener() {
                public void onClick(View v) {
                    Intent sendMailIntent = new Intent(Intent.ACTION_SEND); 
                    sendMailIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.Share_Mail_Subject));
                    sendMailIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.Share_Mail_Text)); 
                    sendMailIntent.setType("text/plain");

                    startActivity(Intent.createChooser(sendMailIntent, "Email / SMS / Tweet ?"));
                }
            }
    );

工作就好在我的最新的应用程序,如果你想测试一下: COMIS试纸在布鲁塞尔

works just fine in my latest app if you want to test it : Comis Strips in Brussels

=>点击[菜单],然后选择[分享],然后按钮[发送电子邮件/短信/资料Tweet] = R.id.btnEnvoyer在我的布局文件,以查看替代品的用户可以选择从...

=> Hit [Menu], then [Share], then the button [Send Email / SMS / Tweet]=R.id.btnEnvoyer in my layout file to see the alternatives the user can choose from ...

希望这有助于你一点...

Hope this helps you a bit ...

小时。