美文网首页
https://developer.android.com/tr

https://developer.android.com/tr

作者: Anonymous_NO1 | 来源:发表于2017-12-29 18:14 被阅读0次

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); }

相关文章

网友评论

      本文标题:https://developer.android.com/tr

      本文链接:https://www.haomeiwen.com/subject/uhtwgxtx.html