打开百度

 Uri uri = Uri.parse("http://www.baidu.com");
 Intent intent =new Intent(Intent.ACTION_VIEW,uri);
startActivity(intent); 打开另一个页面
Intent intent =new Intent(MainActivity.this,Main2Activity.class);
startActivity(intent);
 //拨打电话
Uri uri = Uri.parse("tel:10010");
Intent it = new Intent(Intent.ACTION_DIAL, uri);
startActivity(it);
//权限设置如下
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gis_luq.activitytest1" >
<uses-permission android:name="android.permission.CALL_PHONE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Main2Activity"
android:label="@string/title_activity_main2" >
</activity>
</application> </manifest> 传达信息
Intent intent =new Intent(MainActivity.this,Main2Activity.class);

intent.putExtra("yl1","gisoracle");

//用Bundle携带数据
Bundle bundle=new Bundle();
//传递name参数为tinyphp
bundle.putString("yl2", "我爱你桂霞");
intent.putExtras(bundle);
startActivity(intent);
public class Main2Activity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2); //获取Intent携带数据
Intent intent = getIntent();
String index = intent.getStringExtra("yl1"); //用Bundle携带数据
Bundle bundle = getIntent().getExtras();
String data = bundle.getString("yl2");//读出数据 Toast.makeText(this, index + "-" + data, Toast.LENGTH_SHORT).show();
}

Android Intent调用 Uri的使用几种格式的更多相关文章

  1. android intent调用系统camera

    利用android的camera通常有两种方式:利用intent调用系统的camera,或者结合surfaceview实现自己定制的camera.先分别对这两种方法说明如下: 一.使用系统自配的cam ...

  2. 在Android中使用Android Ksoap2调用WebService

    一.WebService介绍 WebService是基于SOAP协议可实现web服务器与web服务器之间的通信,因采用SOAP协议传送XML数据具有平台无关性,也是成为解决异构平台之间通信的重要解决方 ...

  3. Android Intent的几种用法全面总结

    Android Intent的几种用法全面总结 Intent, 用法 Intent应该算是Android中特有的东西.你可以在Intent中指定程序要执行的动作(比如:view,edit,dial), ...

  4. Android Intent的几种用法总结【转】

    Intent应该算是Android中特有的东西.你可以在Intent中指定程序要执行的动作(比如:view,edit,dial),以及程序执行到该动作时所需要的资料.都指定好后,只要调用startAc ...

  5. Android Intent的几种使用方法全面总结

    Intent应该算是Android中特有的东西.你能够在Intent中指定程序要运行的动作(比方:view,edit,dial),以及程序运行到该动作时所须要的资料.都指定好后,仅仅要调用startA ...

  6. Android 通过Intent调用系统功能和Action动作和服务广播【大全】

    1.从google搜索内容 Intent intent = new Intent(); intent.setAction(Intent.ACTION_WEB_SEARCH);intent.putExt ...

  7. Android:调用其他程序中的activity和Permission Denial: starting Intent 错误解决办法

    今天想调试多个task中栈的情况,在测试程序中调用另一个程序的activity, 代码片段如下: btnStartX=(Button)findViewById(R.id.btnStartX); btn ...

  8. Android开发常用的Intent的URI及示例

    参考资料:http://www.oschina.net/code/snippet_166763_6502 //以下是常用到的Intent的URI及其示例,包含了大部分应用中用到的共用Intent. / ...

  9. android Intent介绍

    Android中提供了Intent机制来协助应用间的交互与通讯,Intent负责对应用中一次操作的动作.动作涉及数据.附加数据进行描述,Android则根据此Intent的描述,负责找到对应的组件,将 ...

随机推荐

  1. 【转】MySQL innodb_autoinc_lock_mode 详解 ,并发插入时主键冲突的解决方案

    本文转载于 http://www.cnblogs.com/JiangLe/p/6362770.html innodb_autoinc_lock_mode这个参数控制着在向有auto_increment ...

  2. Angular Vue React 框架中的 CSS

    框架中的 CSS Angular Vue React 三大框架 Angular Vue 内置样式集成 React 一些业界实践 Angular Angular . js (1.x):没有样式集成能力 ...

  3. JAVA 消耗 CPU过高排查方法

    #找出cpu占用最高的进程top -H#再次确定进程ps aux|grep 17408 #查看进程的线程(tid) ps -mp 17408 -o THREAD,tid,time#将线程转换为十六进制 ...

  4. loj2276 「HAOI2017」新型城市化

    给出的图是一个二分图(显然--吗),一个图的最大团=其补图的最大独立集,因此二分图的最大独立集就是补图的最大团. 欲使补图最大团变大,则要最大独立集变大.二分图最大独立集=点数-最小点覆盖.最小点覆盖 ...

  5. adb devices 找不到夜神模拟器解决方法

    先打开命令行窗口,输入adb devices,查看连接信息,大致意思是sdk的adb版本与夜神的adb版本不一致,导致. C:\Users\cz9025>adb devices List of ...

  6. WordPress后台添加侧边栏菜单

    add_action('admin_menu', 'register_custom_menu_page'); function register_custom_menu_page() { add_me ...

  7. 一个关于python装饰器参数的问题

    看到廖雪峰python教程上,python装饰器一章 https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3 ...

  8. linux shell脚本监控进程是否存在

    用shell脚本监控进程是否存在 不存在则启动的实例,先上代码干货:    #!/bin/shps -fe|grep processString |grep -v grepif [ $? -ne 0 ...

  9. iOS----精品开源库-开发强力助攻

    30个精品iOS开源库,超强助攻 你不会想错过他们,真的. 我爱开源.  文章的尾部你会看到一个太长不看的版本——一个简单的列表,只有标题和到项目的链接.如果你发现这篇文章是有用的,把它和你的iOS开 ...

  10. 【bzoj2467】[中山市选2010]生成树 矩阵树定理

    题目描述 有一种图形叫做五角形圈.一个五角形圈的中心有1个由n个顶点和n条边组成的圈.在中心的这个n边圈的每一条边同时也是某一个五角形的一条边,一共有n个不同的五角形.这些五角形只在五角形圈的中心的圈 ...