Intent的使用:
1.新的页面启动方式
Intent i = new Intent();
i.setComponent(new ComponentName("cn.eoe.intents", "cn.eoe.intents.Aty1"));//第一个参数为当前包名,第二个为目标页面对应的Activity名
startActivity(i);
2.打开SD卡上的一张图片:
File f = new File("/mnt/sdcard/1.jpg");
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(f), "image/*");
startActivity(i);
3.拨打电话:
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("tel:10086"));
startActivity(i);
4.打开网页:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.eoe.cn"));
startActivity(i);