public class ActivityUtils {
/**
* 开启新的activity 并且关闭掉自己
*/
public static void startActivityAndFinish(Activity context, Class cls){
Intent intent = new Intent(context,cls);
context.startActiv...
分类:
其他好文 时间:
2014-11-23 13:13:51
阅读次数:
158
/**
* 安装APK文件
*@param APK文件
*Version:
*author:YangQuanqing
*/
private void installAPK(File file){
//按照系统安装文件的配置信息的意图过滤器才设置意图
Intent _Intent=new Intent();
_Intent.setAction("android.in...
分类:
移动开发 时间:
2014-11-23 13:11:34
阅读次数:
177
pendingIntent是一种特殊的Intent。
主要的区别在于Intent的执行立刻的,而pendingIntent的执行不是立刻的。
pendingIntent执行的操作实质上是参数传进来的Intent的操作,
但是使用pendingIntent的目的在于它所包含的Intent的操作的执行是需要满足某些条件的。
主要的使用的地方和例子:通知Notif...
分类:
其他好文 时间:
2014-11-23 11:50:06
阅读次数:
160
一句话,如果你检查完格式没有错:关于通过adb启动Activity、activity、service以及发送broadcast的命令am broadcast -a myAction --es city "深圳"//通过如下代码获取intent内容Bundle bundle=intent.getExt...
分类:
数据库 时间:
2014-11-23 00:40:48
阅读次数:
951
Intent.ACTION_AIRPLANE_MODE_CHANGED;//关闭或打开飞行模式时的广播Intent.ACTION_BATTERY_CHANGED;//充电状态,或者电池的电量发生变化//电池的充电状态、电荷级别改变,不能通过组建声明接收这个广播,只有通过Context.registe...
分类:
移动开发 时间:
2014-11-22 22:51:15
阅读次数:
265
相信有不少朋友在开发过程中需要监听HOME键的需求,现本人将代码奉上,希望对大家有所帮助!importandroid.content.BroadcastReceiver;importandroid.content.Context;importandroid.content.Intent;importandroid.content.IntentFilter;publicclassHomeWatcher{privatestaticf..
分类:
移动开发 时间:
2014-11-22 19:04:45
阅读次数:
159
启动:
startActivity(intent);
overridePendingTransition(R.anim.tran_next_in, R.anim.tran_next_out);
退出:
@Override
public void finish() {
// TODO Auto-generated method stub
super.finis...
分类:
移动开发 时间:
2014-11-22 12:07:47
阅读次数:
179
1、创建xml文件及按钮
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id...
分类:
其他好文 时间:
2014-11-21 23:28:42
阅读次数:
368
1、创建xml文件及按钮
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id...
分类:
其他好文 时间:
2014-11-21 23:27:21
阅读次数:
417
1、创建xml文件及按钮
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id...
分类:
其他好文 时间:
2014-11-21 23:27:10
阅读次数:
319