首页 > 移动平台 > 详细

android intent filter浏览器应用的设置,如何使用choose-box选择应用

时间:2015-07-23 15:22:59      阅读:285      评论:0      收藏:0      [点我收藏+]
//使用chooserIntent
private void startImplicitActivation() { Log.i(TAG, "Entered startImplicitActivation()"); // TODO - Create a base intent for viewing a URL // (HINT: second parameter uses Uri.parse()) Uri myUri = Uri.parse(URL); Intent baseIntent = new Intent(Intent.ACTION_VIEW, myUri); // TODO - Create a chooser intent, for choosing which Activity // will carry out the baseIntent // (HINT: Use the Intent class‘ createChooser() method) Intent chooserIntent = Intent.createChooser(baseIntent, "Display this url via .."); Log.i(TAG,"Chooser Intent Action:" + chooserIntent.getAction()); // TODO - Start the chooser Activity, using the chooser intent startActivity(chooserIntent); }

设置Intent-filter

1             <!-- TODO - Add necessary intent filter information so that this
2                     Activity will accept Intents with the
3                     action "android.intent.action.VIEW" and with an "http"
4                     schemed URL -->
5             <intent-filter>
6                 <action android:name="android.intent.action.VIEW" />
7                 <category android:name="android.intent.category.DEFAULT" />
8                 <data android:scheme="http"/>
9             </intent-filter>

 

android intent filter浏览器应用的设置,如何使用choose-box选择应用

原文:http://www.cnblogs.com/hitnoah/p/4670553.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!