https://developer.android.com/training/basics/intents/index.html

explicit adj. 明确的;清楚的;直率的;详述的

implicit adj. 含蓄的;暗示的;盲从的

https://developer.android.com/training/basics/intents/sending.html

embedded adj. 嵌入式的;植入的;内含的

https://developer.android.com/training/basics/intents/result.html

Google推荐的打开地图的方案

// Build the intent

Uri location = Uri.parse("geo:0,0?q=1600+Amphitheatre+Parkway,+Mountain+View,+California");

Intent mapIntent = new Intent(Intent.ACTION_VIEW, location);

// Verify it resolves

PackageManager packageManager = getPackageManager();

List activities = packageManager.queryIntentActivities(mapIntent, 0);

boolean isIntentSafe = activities.size() > 0;

// Start an activity if it's safe

if (isIntentSafe) { startActivity(mapIntent); }

谷歌官方推荐获取联系人方法

static final int PICK_CONTACT_REQUEST = 1;

 // The request code 

private void pickContact() {  

  Intent pickContactIntent = new Intent(Intent.ACTION_PICK, Uri.parse("content://contacts"));    

pickContactIntent.setType(Phone.CONTENT_TYPE);

startActivityForResult(pickContactIntent, PICK_CONTACT_REQUEST); }

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容