publicclassBatteryChangedReceiverextendsBroadcastReceiver{@OverridepublicvoidonReceive(Contextcontext,Intentintent){//当前电量intcurrLevel=intent.getIntExtra(BatteryManager.EXTRA_LEVEL,0);//总电量inttotal=intent.getIntExtra(BatteryManager.EXTRA_SCALE,1);int..
分类:
其他好文 时间:
2014-09-05 18:26:22
阅读次数:
190
BUG现象Nexus5等部分机型(安卓4.4版本)出现选择自定义铃声后无法播放的现象。BUG原因4.4的某些机型使用的intent.setAction(Intent.ACTION_GET_CONTENT)获取的uri为content://com.android.providers.media.documents/document/audio%3A1407这种格式的uri在播放音乐的方法中不..
分类:
其他好文 时间:
2014-09-05 03:19:11
阅读次数:
346
Intent intent= new
Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
Context对象.star...
分类:
移动开发 时间:
2014-09-05 00:59:00
阅读次数:
210
Intent
在安卓中,Activity启动时通常需要Intent参数。Intent参数中包含以下几个常用的属性:
Component,指定了要启动的Activity,以及启动的context,使用Intent.setClass或Intent.setComponent方法可以设置;
Action属性,可用Intent.setAction方法设置;
Categor...
分类:
移动开发 时间:
2014-09-04 22:24:20
阅读次数:
241
1、mIntentSenderRecords
是一个PendingIntentRecord哈希表。一个PendingIntentRecord对象对应的是应用层的一个PendingIntent对象(延迟性的intent),其中包含send系列方法,主要用于触发PendingIntent的Intent行为。上层应用每获取一个PendingIntent对象时在AMS这边便会生成对应的PendingIn...
分类:
其他好文 时间:
2014-09-04 22:20:30
阅读次数:
248
/**
*
* 返回桌面
* @param context
*/
public static void toHome(Context context )
{
Intent mHomeIntent = new Intent(Intent.ACTION_MAIN);
mHomeIntent.addCategory(Intent.CATEGORY_HOME);...
分类:
移动开发 时间:
2014-09-04 20:56:30
阅读次数:
249
Intent目前翻译为意图,所谓意图就是想做什么。是Android系统组件之间的通信的桥梁。其描述的基本内容可以分为:conponentName(组件名称)、Action(动作名称)、Data(数据)、Category(类别)、Extra(附加数据)和Log(标志位)六个部分。1、指定conponentName指定组件名称的方式又..
分类:
其他好文 时间:
2014-09-04 19:27:00
阅读次数:
213
原文地址 本文说明如何从 Android 本地图库选择多个图片。作者考虑很多解决方案。 演示从 Android 本地图库选择多个图片,有两个方法可以实现从图库中选择多个图片: 用 Intent 获取多个图片 自定义图库从本地获取和加载图片 下载 Demo 下载 Demo 后将 QDRead...
分类:
移动开发 时间:
2014-09-04 11:44:39
阅读次数:
336
以前都是使用百度API在软件里面做一个百度地图出来这样感觉既浪费时间又浪费精力,这里就教大家直接使用Intent的方式调用手机上安装的百度地图客户端,访问我们所需要的路径规划等, //调起百度地图客户端
try {
...
分类:
移动开发 时间:
2014-09-03 19:58:57
阅读次数:
413
MainActivity如下:
package cc.vv;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android...
分类:
其他好文 时间:
2014-09-02 21:24:25
阅读次数:
274