android平台中调用系统界面
2012-12-25 19:08:20 来源:WEB开发网intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, tel);
intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE_TYPE, 3);
到短信界面:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("vnd.android-dir/mms-sms");
// intent.setData(Uri.parse("content://mms-sms/conversations/"));//此为号码
startActivity(intent);
到应用:
Intent intent = new Intent("android.intent.action.CONVERSATION");
startActivity(intent);
以下是在网上找到的其他方法:
1.从google搜索内容
Intent intent = new Intent();
intent.setAction(Intent.ACTION_WEB_SEARCH);
intent.putExtra(SearchManager.QUERY,"searchString")
startActivity(intent);
2.浏览网页
Uri uri = Uri.parse("http://www.google.com");
Intent it = new Intent(Intent.ACTION_VIEW,uri);
startActivity(it);
3.显示地图
Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.Action_VIEW,uri);
startActivity(it);
4.路径规划
Uri uri = Uri.parse("http://maps.google.com/maps?
f=dsaddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
Intent it = new Intent(Intent.ACTION_VIEW,URI);
startActivity(it);
5.拨打电话
Uri uri = Uri.parse("tel:xxxxxx");
Intent it = new Intent(Intent.ACTION_DIAL, uri);
startActivity(it);
和
uri = Uri.parse("tel:"+number);
intent = new Intent(Intent.ACTION_CALL,uri);
startActivity(intent);
其中不同自己试验一下就知道了。
6.调用发短信的程序
Intent it = new Intent(Intent.ACTION_VIEW);
it.putExtra("sms_body", "The SMS text");
it.setType("vnd.android-dir/mms-sms");
startActivity(it);
和
uri = Uri.parse("smsto:"+要发送短信的对方的number);
intent = new Intent(Intent.ACTION_SENDTO,uri);
startActivity(intent);
和
mIntent = new Intent(Intent.ACTION_VIEW);
mIntent.putExtra("address", c.getString(c.getColumnIndex(column)));
mIntent.setType("vnd.android-dir/mms-sms");
startActivity(mIntent);
7.发送短信
Uri uri = Uri.parse("smsto:0800000123");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
it.putExtra("sms_body", "The SMS text");
startActivity(it);
更多精彩
赞助商链接