// 调出手机market并搜索出相应的APK
Uri uri = Uri.parse("market://search?q=pname:"
+ SCAN_PACKAGE);
Intent scanintent = new Intent(Intent.ACTION_VIEW, uri);
try
{
startActivity(scanintent);
}
catch (ActivityNotFoundException anfe)
{
Log.w(TAG,
"Android Market is not installed; cannot install Barcode Scanner");
}
// 调至系统联系人界面,选择联系人,并返回数据
Intent intent = new Intent();
intent.setAction(Intent.ACTION_PICK);
intent.setData(ContactsContract.Contacts.CONTENT_URI);
try
{
startActivityForResult(intent, FLAG_RESULT_SYS_CONTACTS);
}
catch (ActivityNotFoundException e1)
{
e1.printStackTrace();
Log.w(TAG, "No contacts pick...");
}
本文详细介绍了如何通过调用手机市场应用市场并搜索指定的APK来安装应用程序,以及如何通过系统联系人界面选择联系人并获取相关数据。
3092

被折叠的 条评论
为什么被折叠?



