我使用下面的代码获取一个 intent 的 packageName 和 activityInfo.name。
我希望获取一个快捷菜单名称如:"Add to dropbox",和下面的图表示的一样,如何实现?
private void GetShare() {
Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("image/*");
List<ResolveInfo> resInfo = getPackageManager().queryIntentActivities(share, 0);
if (!resInfo.isEmpty()){
for (ResolveInfo info : resInfo) {
Toast.makeText(getApplicationContext(),info.activityInfo.packageName.toLowerCase()
+" CW "
+info.activityInfo.name.toLowerCase()
,Toast.LENGTH_LONG).show();
}
}
}