关于Intent.setDataAndType参数问题】的更多相关文章

一.传递List<String>和List<Integer>以下以传递List<String>为例,发送List<String>语法为:intent.putStringArrayListExtra(key, list);接收List<String>的语法为:list = (ArrayList<String>)getIntent().getStringArrayListExtra(key);以下是一个运用实例: [java] view…
来建第一个Activity:MyIntent  [mw_shl_code=java,true]public class MyIntent extends Activity {                  /*声明控件对象*/         private EditText et1, et2;         private Button   bt;              /** Called when the activity is first created. */     @Ov…
主界面上是两个EditText和一个按钮.用于输入两个数字参数. calcute.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layou…
Intent 是Android 程序中各组件之间进行交互的一种重要方式,它不仅可以指明当前组 件想要执行的动作,还可以在不同组件之间传递数据.Intent 一般可被用于启动活动.启动 服务.以及发送广播等场景 // A activity调用 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.act…
新建一个FirstAvtivity.java package com.zhuguangwei; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class First…
不管是在APP,还是在网站中,页面之间的跳转都是很常见的,本文主要讲一下在APP中,如何通过Intent实现页面的跳转. 不带参数: 写在MainActivity页面的代码: Intent intent = new Intent(); intent.setClass(MainActivity.this, LoginActivity.class);//从MainActivity页面跳转至LoginActivity页面 this.startActivity(intent); 带参数: 写在Spend…
1 Data  执行时要操作的数据 在目标<data/>标签中包含了以下几种子元素,他们定义了url的匹配规则: android:scheme 匹配url中的前缀,除了“http”.“https”.“tel”...之外,我们可以定义自己的前缀 android:host 匹配url中的主机名部分,如“google.com”,如果定义为“*”则表示任意主机名 android:port 匹配url中的端口 android:path 匹配url中的路径 在XML中声明可以操作的data域应该是这样的:…
------Intent------ Android中三个核心组件——Activity.Services.BroadCastProvider都是通过Intent传递参数. startActivity(Intent)/startActivityForResult(Intent):来启动一个Activity startService(Intent)/bindService(Intent):来启动一个Service sendBroadcast:发送广播到指定BroadcastReceiver Inte…
Intent分为两大类: (1)显性的(Explicit) (2)隐性的(Implicit) 对于隐性意图,在某些时候, 应用程序只是想启动具有某种特征的组件, 并不想和某个特定的组件耦合. 使用Intent可以方便的达到这种高层次解耦的目的.(在模块间的组件启动) intent定位事件的目的地: (1)种类(category),比如我们常见的 LAUNCHER_CATEGORY 就是表示这是一类应用程序. (2)类型(type),在前面的例子中没用过,表示数据的类型,这是隐性Intent定位目…
Intent是一种运行时绑定(run-time binding)机制,它能在程序运行过程中连接两个不同的组件.通过Intent,你的程序可以向Android表达某种请求或者意愿,Android会根据意愿的内容选择适当的组件来完成请求.比如,有一个Activity希望打开网页浏览器查看某一网页的内容,那么这个Activity只需要发出WEB_SEARCH_ACTION给Android,Android就会根据Intent的请求内容,查询各组件注册时声明的IntentFilter,找到网页浏览器的Ac…