- 浏览: 47646 次
- 性别:
- 来自: 西安
最新评论
1 关于onPause():
onPause() is always called when the Activity ends, even if we
instigated that (with a finish() call for example). We will use this to save the current data back to the database. Good practice is to release any resources that can be released during an onPause()
as well, to take up less resources when in the passive state。
2 关于onSaveInstanceState();
There is no guarantee that onSaveInstanceState()
will be called and because when it is called, it is called before onPause()
.
3关于 assets: Files in assets/
are not given a resource ID, so you can read them only using AssetManager
4
这个类用一下几种方式来告诉user 在device的 background发生了些什么事情
A persistent icon that goes in the status bar and is accessible through the launcher, (when the user selects it, a designated Intent can be launched),
- Turning on or flashing LEDs on the device, or
- Alerting the user by flashing the backlight, playing a sound, or vibrating.
每一个notify methods会以一个int 型的id 作为参数。这个id是作为notification唯一的标识(因为系统中会有很多的notification),当你用同样的id调用一个notify methods
的时候,相当于更新这个notification。你可以通过getSystemService(String)获得一个android.app.NotificationManager的实例对象
5在android中context可以作很多操作,但是最主要的功能 是加载 和访问资源 。在android中有两种context,一种是 application context,一种是activity context,
通常我们在各种类和方法间传递的是activity context。
比如一个activity的onCreate:
protected void onCreate(Bundle state) {
super.onCreate(state);
TextView label = new TextView(this); //传递context给view control
label.setText("Leaks are bad");
setContentView(label);
}
把activity context传递给view,意味着view拥有一个指向activity的引用,进而引用activity占有的资源:view hierachy, resource等。
5 Intent 与 pendingIntent的区别
intent英文意思是意图,pending表示即将发生或来临的事情。
PendingIntent这个类用于处理即将发生的事情。比如在通知Notification中用于跳转页面,但不是马上跳转。
Intent 是及时启动,intent 随所在的activity 消失而消失。
PendingIntent 可以看作是对intent的包装,通常通过getActivity,getBroadcast ,getService来得到pendingintent的实例,当前activity并不能马上启动它所包含的intent,而是在外部执行 pendingintent时,调用intent的。正由于pendingintent中 保存有当前App的Context,使它赋予外部App一种能力,使得外部App可以如同当前App一样的执行pendingintent里的 Intent, 就算在执行时当前App已经不存在了,也能通过存在pendingintent里的Context照样执行Intent。另外还可以处理intent执行后的操作。常和alermanger 和notificationmanager一起使用。
Intent一般是用作Activity、Sercvice、BroadcastReceiver之间传递数据,而Pendingintent,一般用在 Notification上,可以理解为延迟执行的intent,PendingIntent是对Intent一个包装。
6 RemoteViews 就是一个可以显示在其它进程中对象
7 (1)Service生命周期只有onCreate, onStart和onDestroy,没有onResume, onPause和onStop 。如果你在onCreate或onStart做一些很耗时间的事情,最好启动一个线程来完成,因为如果Service是跑在主线程中的,会影响到你的UI操作或者阻塞主线程中的其他事情。BroadcastReceiver只能通过startService启动Service ,因为广播本身生命周期很短,bind的话没有意义\
8 HandlerThread
Handy class for starting a new thread that has a looper.
发表评论
-
Android Intent and Intent Filter (转)
2011-03-10 22:47 1459Android Intent and Intent ... -
Intent详解
2011-03-03 14:18 1141在应用中,我们可以以两种形式来使用Intent: 直接I ... -
Intent间传送数据一般有两种常用方法
2011-01-24 14:50 1306Intent间传送数据一般有两种常用的办法: 1.extra ... -
android RelativeLayout 详解
2011-01-01 09:46 1580<?xml version="1.0" ... -
How to Use Android Downloads Provider
2010-12-20 21:41 1331本文转载自 http://blog.lytsing.or ... -
content provider 深入解析
2010-12-15 22:04 1098Content providers are on ... -
Service的高级应用
2010-12-12 20:48 1356下面是android Service的高级应用的一个例子,主要 ... -
TabActivity
2010-12-12 19:09 1772下面是一个使用android tabactivity 的例子 ... -
android 测试初探(android test)
2010-12-07 15:00 8015android Testing and Instrumenta ... -
Localization of android
2010-12-05 21:51 0android 会在不同地域的不同机器上运行。为了是应用能够 ... -
android高效编程之使用本地变量
2010-12-05 14:26 976hava a look at the following co ... -
在不同的Activity中传递对象的方法
2010-12-02 10:20 2011下面我们将要实现的功 ... -
Cursor与Adapter
2010-11-21 08:34 1226来自: http://hi.baidu.com/lfcaoli ... -
Working with Context Menus
2010-11-15 23:36 861... -
Handler的理解
2010-11-14 20:58 836A Handler allows you to sen ... -
android开发问题解决日志
2010-11-14 18:33 18801.、android中R文件消失的处理方式 ... -
android 中对SDCard 的操作
2010-11-11 14:14 1637对于像视频这样的大文件,我们可以把它存放在SDCard。 SD ... -
ViewAnimation
2010-11-05 12:46 1039view animation 的实现 Understandi ... -
android高效的编写高效代码
2010-10-17 19:13 788本文来源于: 从此学习网 原文: http://www.con ... -
scale animation
2010-10-11 23:29 1610Scale animation: You use this t ...
相关推荐
以下是一些重要的Android开发知识点的详细解析: 1. **单实例运行方法** Android系统中,Activity是以历史栈的形式管理的,若要实现单实例模式,不能简单地在`application`节点设置`android:launchMode=...
个人总结的一些android开发基础知识,希望对你有所帮助。
以下是对标题“android开发知识点汇总”和描述中提到的一些重要技术点的详细解析: 1. **知识库.txt**: 这个文件可能包含了Android开发的基础知识,如组件生命周期、布局管理、数据存储、网络请求、多线程处理等...
总之,这份"Android开发笔记"是一套全面的学习资源,涵盖了从基础到进阶的Android开发知识,特别关注在real6410开发板上的实践。通过深入阅读并实践这些教程,开发者不仅可以提升Android应用开发技能,还能掌握在...
总之,"Android开发入门60个小案例+源代码"是一个宝贵的资源,它涵盖了Android开发的众多基础知识点,通过实践这些小案例,初学者可以快速上手,逐步掌握Android应用开发的核心技术。同时,源代码提供了直接参考和...
Android开发核心知识点笔记 涵盖了以下七大板块的知识点: 1、Java知识点汇总 2、Android知识点汇总 3、Android扩展知识点 4、Android开源库源码分析 5、设计模式汇总 6、Gradle知识点汇总 7、常见面试算法题汇总
精致排版,没有广告 大纲: 一、Java知识点汇总 二、Android知识点汇总 三、Android扩展知识点 四、Android开眼库源码分析 五、设计模式汇总 六、Gradle知识点汇总 七、常见面试算法题汇总
android开发知识点大全,知识点+示例代码,帮助你很快掌握android开发的各种基础技能,
Android开发一些重要知识点.doc
第一,介绍Android开发者不容易掌握的一些知识点;第二,结合Android源代码和应用层开发过程,融会贯通,介绍一些比较深入的知识点;第三,介绍一些核心技术和Android的性能优化思想。 《Android开发艺术探索》侧重...
在Android开发中,掌握一些关键知识点能够帮助开发者创建高效、兼容性强的应用。以下是一些重要的Android知识点的详细解释: 1. **单实例运行方法** 在Android中,单实例模式通常用于确保应用只有一个活动实例。...
而对于高级开发者来说,仍然可以从《Android开发艺术探索》的知识体系中获益。 作译者 任玉刚,百度公司Android高级工程师,硕士毕业于中国科学技术大学,在CSDN发表多篇高质量的技术文章并广获好评,并多次在...
《Android开发艺术探索》是一本Android进阶类书籍,采用理论、源码和实践相结合的方式来阐述高水准的Android应用开发要点。...而对于高级开发者来说,仍然可以从《Android开发艺术探索》的知识体系中获益。
代码仅供初学者参考,对于有一定学习时长的入门者无参考价值,通过完整项目可体会到一些简单的应用开发思路和解决方法,涉及到一些简单的知识点,关于数据库,广播,内容接收者,服务,内容提供者等没有涉及。...
知识点一: Android 开发环境搭建 * 下载和安装 JDK 和 Android SDK * 配置 IDE 增加 SDK 支持 * 打开 Android SDK Manager,下载和安装所需的 Android 版本 * 创建新项目,选择 Android 的 Application Module * ...
Android开发知识点详细介绍
本文将根据“学习android需要的Java知识点列表”中的内容,详细阐述学习Android开发过程中需要掌握的核心Java知识点。 #### 1. Java SDK安装与配置 - **Java SDK**(Software Development Kit)是进行Java程序开发...
本文主要介绍使用Android Studio开发Android App实现联网功能的步骤和关键知识点。互联网功能是 Android App 的核心功能之一,本文将详细讲解如何使用Android Studio开发联网功能,包括准备工作、具体实施和异常处理...