第一步:
uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
/>
uses-permission
android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
/>
第二步:
Intent intent =...
分类:
移动开发 时间:
2014-11-06 20:07:40
阅读次数:
162
在配置文件AndroidManifest.xml中向系统注册receiver,子节点 intent-filter 表示接收android.intent.action.BOOT_COMPLETED 消息同时需要添加相应权限在Receiver中就可以添加开机需要进行的操作在Receiver中就可以添加开...
分类:
移动开发 时间:
2014-11-06 19:57:02
阅读次数:
237
要求:页面1跳转到页面2,页面2再返回页面1同时返回数据页面1添加如下代码: Intent intent = new Intent(); intent.setClass(页面1.this, 页面2.class); Bundle bundle = new Bundle(); intent....
分类:
移动开发 时间:
2014-11-06 19:17:44
阅读次数:
151
Intent用法实例1.无参数Activity跳转Intent it =newIntent(Activity.Main.this, Activity2.class); startActivity(it);2.向下一个Activity传递数据(使用Bundle和Intent.putExtras)Int...
分类:
其他好文 时间:
2014-11-06 16:36:33
阅读次数:
131
Android:实现两个Activity相互切换而都不走onCreate().(程序更加流畅!)...
分类:
移动开发 时间:
2014-11-06 12:59:57
阅读次数:
192
今天在做android widget时发现点击任意widget时只会更新最后一个widget原来是requestCode的问题 Intent intent = new Intent(WidgetProvider.ACTION_SWITCH); intent.putExtra(AppWidgetMan...
分类:
其他好文 时间:
2014-11-05 19:35:42
阅读次数:
174
1.显式调用方法Intent intent = new Intent(this, OtherActivity.class);//方法1Intent intent2 = new Intent();intent2.setClass(this, OtherActivity.class);//方法2inte...
分类:
移动开发 时间:
2014-11-05 18:56:40
阅读次数:
225
Intent.ACTION_AIRPLANE_MODE_CHANGED;//关闭或打开飞行模式时的广播Intent.ACTION_BATTERY_CHANGED;//充电状态,或者电池的电量发生变化//电池的充电状态、电荷级别改变,不能通过组建声明接收这个广播,只有通过Context.registe...
分类:
移动开发 时间:
2014-11-05 18:55:48
阅读次数:
216
Android应用程序中有三个核心组件Activity、Services、Broadcast Receiver.Intent 提供应用程序之间的的交互机制,负责对一次操作的动作,动作涉及的数据,附加数据进行描述,Android则根据此Intent的描述,负责找对应的组件,将Intent传递给对应的组...
分类:
移动开发 时间:
2014-11-05 17:07:44
阅读次数:
152