• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Patata
http://weibo.com/totome
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 下一页
2012年8月31日
onSaveinstancestate 保存和恢复activity的状态数据
摘要: 一般来说, 调用onPause()和onStop()方法后的activity实例仍然存在于内存中, activity的所有信息和状态数据不会消失, 当activity重新回到前台之后, 所有的改变都会得到保留.但是当系统内存不足时, 调用onPause()和onStop()方法后的activity可能会被系统摧毁, 此时内存中就不会存有该activity的实例对象了. 如果之后这个activity重新回到前台, 之前所作的改变就会消失. 为了避免此种情况的发生, 开发者可以覆写onSaveInstanceState()方法. onSaveInstanceState()方法接受一个Bundle类 阅读全文
posted @ 2012-08-31 22:27 Blacksky 阅读(1851) 评论(0) 推荐(0)
Activity任务堆栈 四种launchMode
摘要: 1 /** 2 * 演示一:FLAG_ACTIVITY_NEW_TASK 3 * 当传递给startActivity()的Intent对象包含 FLAG_ACTIVITY_NEW_TASK 标记时, 4 * 系统会为需要启动的activity寻找与当前activity不同的task。 5 * 如果要启动的 activity的affinity属性与当前所有的task的affinity属性都不相同, 6 * 系统会新建一... 阅读全文
posted @ 2012-08-31 11:00 Blacksky 阅读(652) 评论(0) 推荐(0)
Android 系统体系结构
摘要: 阅读全文
posted @ 2012-08-31 10:26 Blacksky 阅读(391) 评论(0) 推荐(0)
startActivityForResult
摘要: 1 /** 2 * 3 * 函数名称 : registerListener 4 * 功能描述 : 注册监听 5 * 参数及返回值说明: 6 * 7 * 修改记录: 8 * 日期:2011-12-13 上午10:14:03 修改人:gy 9 * 描述 :10 *11 */12 private void registerListener()13 {14 btnStartActivityForResult.setOnClic... 阅读全文
posted @ 2012-08-31 10:24 Blacksky 阅读(430) 评论(1) 推荐(0)
PendingIntent 结合Notification的使用
摘要: 是封装了一个 Intent 以及 Intent 接收者的描述对象,它是一种延迟执行的 Intent, 该 PendingIntent 不会立即被处理,而是交付给其他应用程序,等待一个事件的触发后被送出PendingIntent 的构造getActivity(Context context, int reqCode, Intent, int flag)getBroadcast(Context context, int reqCode, Intent, int flag)getService(Context context, int reqCode, Intent, int flag)Pendin 阅读全文
posted @ 2012-08-31 10:00 Blacksky 阅读(592) 评论(0) 推荐(0)
自定义 Permmision 权限
摘要: Activity 注册属性中 android:permission 为 Activity 加了一个权限,只有拥有这个权限的应用程序才能够调用到这个 Activity注册权限:<permission android:name="com.great.activity_intent.mypermission1" android:protectionLevel="normal" />权限级别:normal (普通级别):默认值,只要申请,就可以使用dangerous(危险级别):会给程序一个提示或警告signature(签名级别):只有拥有相同的签名 阅读全文
posted @ 2012-08-31 09:19 Blacksky 阅读(408) 评论(0) 推荐(0)
2012年8月30日
Activity详解 Intent显式跳转和隐式跳转
摘要: Activity 生命周期显式 Intent 调用 1 //创建一个显式的 Intent 对象(方法一:在构造函数中指定) 2 Intent intent = new Intent(Intent_Demo1.this, Intent_Demo1_Result1.class); 3 4 Bundle bundle = new Bundle(); 5 bundle.putString("id", strID); 6 intent.putExtras(bundle); 7 8 intent.putExtra("name... 阅读全文
posted @ 2012-08-30 22:20 Blacksky 阅读(4228) 评论(0) 推荐(1)
菜单和上下文菜单的创建
摘要: 菜单对象复写Activity的方法 1 /** 2 * 函数名称 : onCreateOptionsMenu 3 * 功能描述 : 创建选项菜单 4 * 参数说明: 5 * @param menu 6 * @return 7 * 返回值: 8 * 9 * 修改记录:10 * 日期:2011-11-25 上午11:27:33 修改人:gy11 * 描述 :12 * 13 */14... 阅读全文
posted @ 2012-08-30 21:20 Blacksky 阅读(435) 评论(0) 推荐(0)
UI布局 4种布局方法
摘要: 布局产生器LayoutInflater获取布局产生器的方法context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)LayoutInflater.from(Context)1 //获取布局产生器(方法一),通过 getSystemService 方法返回系统级的处理程序实例2 LayoutInflater inflater = = this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);3 4 //获取布局产生器(方法二)5 LayoutInflater inflater = ... 阅读全文
posted @ 2012-08-30 20:10 Blacksky 阅读(1807) 评论(0) 推荐(0)
Android 中各种XML文件的作用
摘要: 1、arrays.xml 定义数组1 <resources>2 <string-array name="proxy_types">3 <item>HTTP</item>4 <item>SOCKS4</item>5 <item>SOCKS5</item>6 </string-array> 7 </resources>2、colors.xml 定义颜色 1 <resources> 2 <color name="blue_sky&qu 阅读全文
posted @ 2012-08-30 11:40 Blacksky 阅读(1089) 评论(0) 推荐(0)
上一页 1 2 3 4 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3