1,知道要启动的包名以及要启动的Activity:
Intent intent = new Intent();
/**下面方法的参数分别是指要启动应用的包名及对应的Activity*/
ComponentName cpn= new ComponentName("com.ldm.demo","com.ldm.demo.TextAct...
分类:
移动开发 时间:
2015-05-11 10:54:39
阅读次数:
169
在学习Android的过程中,Intent是我们最常用Android用于进程内或进程间通信的机制,其底层的通信是以Binder机制实现的,在物理层则是通过共享内存的方式实现的。 Intent主要用于2种情景下:(1)发起意图 (2)广播 它的属性有:ComponentName,action,d...
分类:
Web程序 时间:
2015-05-05 16:03:02
阅读次数:
110
在android中,Intent的使用可算是无处不在,它起到了媒介的作用,可以当做一条指令,或者一种协议。它的作用是告诉android系统要做什么和怎么做该Intent对象组要由六部分,分别是Componentname,Action,Data,Category,Extras以及Flags。那么这些部分分别起到什么作用,以及..
分类:
其他好文 时间:
2015-04-28 18:53:06
阅读次数:
121
Service类中和Service绑定有关的回调函数有2个:
1.IBinder onBind(Intent intent);
该方法的返回值会传递给android.content.ServiceConnection.onServiceConnected(ComponentName name, IBinder service),如果该方法返回值为null,则该Service不能...
分类:
其他好文 时间:
2015-04-23 09:42:58
阅读次数:
185
Intent mIntent = new Intent();
ComponentName comp = new ComponentName("启动的APK包名","启动的APK入口类(包名加类名)");
mIntent.setComponent(comp);
mIntent.setAction("android.intent.action.MA...
分类:
移动开发 时间:
2015-03-16 12:58:06
阅读次数:
219
1, 构造intent Intent mIntent = new Intent("android.intent.action.MAIN"); ComponentName comp = new ComponentName( "c...
分类:
其他好文 时间:
2015-03-02 16:45:27
阅读次数:
208
AndroidApp的源代码:---------------------------------------------------------------------------------------------//myActivity.javapackagecom.misoo.pk01;importandroid.app.Activity;importandroid.content.BroadcastReceiver;importandroid.content.ComponentName;im..
分类:
移动开发 时间:
2015-03-01 22:27:54
阅读次数:
247
ActivityManager am = (ActivityManager) this .getSystemService(ACTIVITY_SERVICE); List taskInfo = am.getRunningTasks(1); ComponentName componentInfo .....
分类:
移动开发 时间:
2015-02-12 10:29:30
阅读次数:
166
Intent中可以直接使用Intent.setClass(),也可以使用组件Component.简单的使用方式如下: 1 package com.example.test; 2 3 import android.os.Bundle; 4 import a...
分类:
移动开发 时间:
2015-01-14 12:24:32
阅读次数:
280
import java.util.Locale;import android.app.Activity;import android.content.ComponentName;import android.content.Intent;import android.content.pm.Activ...
分类:
移动开发 时间:
2015-01-12 10:47:32
阅读次数:
156