当前位置:K88软件开发文章中心编程语言APP编程Android01 → 文章内容

4.5.1 Intent的基本使用

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-12 6:26:22

der.Contacts.Intents.Insert.TERTIARY_PHONE,"workPhone"); it.putExtra(android.provider.Contacts.Intents.Insert.JOB_TITLE,"title"); startActivity(it);//===============================================================//19.调用系统编辑添加联系人(全有效):Intent intent = newIntent(Intent.ACTION_INSERT_OR_EDIT); intent.setType(People.CONTENT_ITEM_TYPE); intent.putExtra(Contacts.Intents.Insert.NAME, "My Name"); intent.putExtra(Contacts.Intents.Insert.PHONE, "+1234567890"); intent.putExtra(Contacts.Intents.Insert.PHONE_TYPE,Contacts.PhonesColumns.TYPE_MOBILE); intent.putExtra(Contacts.Intents.Insert.EMAIL, "com@com.com"); intent.putExtra(Contacts.Intents.Insert.EMAIL_TYPE, Contacts.ContactMethodsColumns.TYPE_WORK); startActivity(intent);//===============================================================//20.打开另一程序 Intent i = new Intent(); ComponentName cn = new ComponentName("com.example.jay.test", "com.example.jay.test.MainActivity"); i.setComponent(cn); i.setAction("android.intent.action.MAIN"); startActivityForResult(i, RESULT_OK);//===============================================================//21.打开录音机Intent mi = new Intent(Media.RECORD_SOUND_ACTION); startActivity(mi);//===============================================================//22.从google搜索内容 Intent intent = new Intent(); intent.setAction(Intent.ACTION_WEB_SEARCH); intent.putExtra(SearchManager.QUERY,"searchString") startActivity(intent);//===============================================================6.Action在哪里查?本来想直接贴以前收集到的Intent Action的,后来想想还是算了,授之以鱼,还不如授之以渔,如果你下载了Android的文档的话,可以在下述路径:sdk-->docs-->reference-->android--->content--->Intent.html找到这个玩意,然后从这个Constants开始就是了:遇到陌生的自己来这里查即可~本节小结:好的,关于Intent的基本使用就到这里,下一节我们会来继续学习在日常开发中使用Intent可能会遇到的一些问题或者说需求吧,敬请期待,谢谢~

上一页  [1] [2] [3] 


4.5.1 Intent的基本使用