07 2015 档案

android小笔记
摘要:1、启动其他应用程序Intent launchIntent = getPackageManager().getLaunchIntentForPackage(currentAppInfo.getPackageName()); startActivity(launchIntent); 阅读全文

posted @ 2015-07-14 14:25 石头hah 阅读(167) 评论(0) 推荐(0)

android有点纠结的小问题
摘要:1、点击一个listview的item,以popupwindow的形式展示一个菜单。popupwindow以动画的形式展现,可一直没有预期的效果 解决方案:popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT))... 阅读全文

posted @ 2015-07-14 13:45 石头hah 阅读(125) 评论(0) 推荐(0)

持久化应用程序实例的状态
摘要:我们度知道,android应用程序的生命周期不是由它自己控制的,当资源匮乏的时候,android为了保障用户体验,就会释放那些进程优先级比较低的应用程序。此时保存应用程序的实例状态,就变得极其重要activity生命周期中有一个onSaveInstanceState方法,此方法是在onResume执... 阅读全文

posted @ 2015-07-03 15:48 石头hah 阅读(267) 评论(0) 推荐(0)

preference activity框架
摘要:从android3.0开始preference框架做了重大改变框架由一下四部分组成1、preference screen布局 一个xml文件,指定了要显示的Preference控件。 每个控件应当至少包含4个属性key,title,summary,default value2、preferenc... 阅读全文

posted @ 2015-07-03 15:28 石头hah 阅读(211) 评论(0) 推荐(0)

android的Broadcast receiver
摘要:broadcast receiver是用来监听intent的。android大量使用了broadcast receiver,比如:开机、电话打进来、发送消息,手机电量过低有两种方式注册broadcast receiver。1、代码中注册 2、在manifest文件中进行注册 使用这种方式注册的r... 阅读全文

posted @ 2015-07-02 14:36 石头hah 阅读(169) 评论(0) 推荐(0)

常用的隐式意图
摘要:1、跳转到拨号界面 Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber));2、直接拨号 Intent intent = new Intent(Intent.ACTION_CALL, Uri... 阅读全文

posted @ 2015-07-01 21:57 石头hah 阅读(382) 评论(0) 推荐(0)

android应用程序的优先级
摘要:andorid系统为保障应用程序运行的流畅性,当内存资源比较匮乏的时候会杀死那些优先级比较低的进程android进程的优先级如下图:1、活动进程: 是指那些正在与用户进行交互的应用程序进程,这种组件很少。 比如: ①、正在与用户交互的activity; ②、正在执行onrecieve... 阅读全文

posted @ 2015-07-01 09:30 石头hah 阅读(693) 评论(0) 推荐(0)

导航