【发布时间】:2019-08-25 05:07:00
【问题描述】:
请清楚地告诉我们什么是意图和意图过滤器。我可以在组件中创建意图过滤器而不是在清单中声明。请告诉我们。
意图actionIntent=新意图(动作); //if(action.matches("ACTION_SEND")){
actionIntent.putExtra(Intent.EXTRA_EMAIL,"xxx@gmail.com");
actionIntent.putExtra(Intent.EXTRA_SUBJECT, "first example");
actionIntent.putExtra(Intent.EXTRA_TEXT, "prepating for interivew-test examples");
//need this to prompts email client only
actionIntent.setType("message/rfc821");
startActivity(Intent.createChooser(actionIntent, "Choose an Email client :"));
清单:
<category android:name = "android.intent.category.DEFAULT" />
</intent-filter>
【问题讨论】:
标签: android-intent android-manifest intentfilter