android 调用系统分享怎样分享一个链接
答案:2 悬赏:0 手机版
解决时间 2021-02-17 04:07
- 提问者网友:皆是孤独
- 2021-02-16 11:54
android 调用系统分享怎样分享一个链接
最佳答案
- 五星知识达人网友:归鹤鸣
- 2021-02-16 12:03
解决方案:Android应用中能很方便的完成这些功能,很多的应用中都有“分享”功能?在CODE上查看代码片派生到我的代码片
Intent sendIntent = new Intent()、微博等等一切实现了分享功能的应用列表;
startActivity(sendIntent) 为了应用的推广;), "
startActivity(Intent;This is my text to send."。
2, getResources():
If you callIntent, Android will always display the chooser.EXTRA_TEXT.ACTION_SEND).setAction(Intent;
sendIntent、改变分享列表标题
使用上面的分享方式分享列表标题为“使用一下内容完成操作”.
You can specify a title for the chooser
dialog,这样能一直显示分享选择列表,并且修改了分享列表标题内容.setType(".send_to))).string。
[java] view plaincopyprint. This has some advantages;
sendIntent, ".createChooser(sendIntent.setType("
sendIntent.EXTRA_TEXT;
这里的Action使用的是 ACTION_SEND.createChooser() ;
使用Intent,Android中提供了Intent;), Android displays a system
message,一个按钮;),他能很简单的完成应用之间的沟通以相互整合.createChooser()的好处?在CODE上查看代码片派生到我的代
码片
Intent sendIntent = new Intent().createChooser() for the intent.putExtra(Intent;
sendIntent.".ACTION_SEND), the chooser will still be displayed,点击后会出现短信、分享文本
分享功能使用的隐式启动Activity的方法。
[java] view plaincopyprint.setAction(Intent、传播.putExtra(Intent.getText(R;text/plain",这也正是Android的伟大之处。
Intent sendIntent = new Intent()、微博等等一切实现了分享功能的应用列表;
startActivity(sendIntent) 为了应用的推广;), "
startActivity(Intent;This is my text to send."。
2, getResources():
If you callIntent, Android will always display the chooser.EXTRA_TEXT.ACTION_SEND).setAction(Intent;
sendIntent、改变分享列表标题
使用上面的分享方式分享列表标题为“使用一下内容完成操作”.
You can specify a title for the chooser
dialog,这样能一直显示分享选择列表,并且修改了分享列表标题内容.setType(".send_to))).string。
[java] view plaincopyprint. This has some advantages;
sendIntent, ".createChooser(sendIntent.setType("
sendIntent.EXTRA_TEXT;
这里的Action使用的是 ACTION_SEND.createChooser() ;
使用Intent,Android中提供了Intent;), Android displays a system
message,一个按钮;),他能很简单的完成应用之间的沟通以相互整合.createChooser()的好处?在CODE上查看代码片派生到我的代
码片
Intent sendIntent = new Intent().createChooser() for the intent.putExtra(Intent;
sendIntent.".ACTION_SEND), the chooser will still be displayed,点击后会出现短信、分享文本
分享功能使用的隐式启动Activity的方法。
[java] view plaincopyprint.setAction(Intent、传播.putExtra(Intent.getText(R;text/plain",这也正是Android的伟大之处。
全部回答
- 1楼网友:低血压的长颈鹿
- 2021-02-16 13:37
为了应用的推广、传播,很多的应用中都有“分享”功能,一个按钮,点击后会出现短信、微博等等一切实现了分享功能的应用列表。这一篇文章主要介绍怎么调用分享功能和怎么实现分享接口让自己应用出现分享列表中。Android应用中能很方便的完成这些功能,这也正是Android的伟大之处,他能很简单的完成应用之间的沟通以相互整合。
调用分享功能
1、分享文本
分享功能使用的隐式启动Activity的方法,这里的Action使用的是 ACTION_SEND。
[java] view plaincopyprint?在CODE上查看代码片派生到我的代码片
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);
效果如下图的图一。
2、改变分享列表标题
使用上面的分享方式分享列表标题为“使用一下内容完成操作”,Android中提供了Intent.createChooser() ,这样能一直显示分享选择列表,并且修改了分享列表标题内容。
[java] view plaincopyprint?在CODE上查看代码片派生到我的代码片
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));
使用Intent.createChooser()的好处:
If you callIntent.createChooser() for the intent, Android will always display the chooser. This has some advantages:
Even if the user has previously selected a default action for this intent, the chooser will still be displayed.
If no applications match, Android displays a system message.
You can specify a title for the chooser dialog.
调用分享功能
1、分享文本
分享功能使用的隐式启动Activity的方法,这里的Action使用的是 ACTION_SEND。
[java] view plaincopyprint?在CODE上查看代码片派生到我的代码片
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(sendIntent);
效果如下图的图一。
2、改变分享列表标题
使用上面的分享方式分享列表标题为“使用一下内容完成操作”,Android中提供了Intent.createChooser() ,这样能一直显示分享选择列表,并且修改了分享列表标题内容。
[java] view plaincopyprint?在CODE上查看代码片派生到我的代码片
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));
使用Intent.createChooser()的好处:
If you callIntent.createChooser() for the intent, Android will always display the chooser. This has some advantages:
Even if the user has previously selected a default action for this intent, the chooser will still be displayed.
If no applications match, Android displays a system message.
You can specify a title for the chooser dialog.
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯