随笔分类 -  android

摘要:Android Activity的onSaveInstanceState() 和 onRestoreInstanceState()方法:1.基本作用: Activity的 onSaveInstanceState() 和 onRestoreInstanceState()并不是生命周期方法,它们不同于... 阅读全文
posted @ 2015-12-03 11:10 yangan 阅读(203) 评论(0) 推荐(0)
摘要:获取SharedPreferences的两种方式:1 调用Context对象的getSharedPreferences()方法2 调用Activity对象的getPreferences()方法两种方式的区别:调用Context对象的getSharedPreferences()方法获得的SharedP... 阅读全文
posted @ 2015-11-29 19:49 yangan 阅读(387) 评论(0) 推荐(0)
摘要:pendingIntent是一种特殊的Intent。主要的区别在于Intent的执行立刻的,而pendingIntent的执行不是立刻的。pendingIntent执行的操作实质上是参数传进来的Intent的操作,但是使用pendingIntent的目的在于它所包含的Intent的操作的执行是需要满... 阅读全文
posted @ 2015-11-26 16:35 yangan 阅读(3123) 评论(0) 推荐(0)
摘要:A PendingIntent itself is simply a reference to a token maintained by the system describing the original data used to retrieve it. This means that, ev... 阅读全文
posted @ 2015-11-26 16:10 yangan 阅读(503) 评论(0) 推荐(0)
摘要:目录(?)[-]public static PendingIntent getActivity Context context int requestCode Intent intent int flagsParametersReturnspublic void sendNotification(C... 阅读全文
posted @ 2015-11-26 15:32 yangan 阅读(291) 评论(0) 推荐(0)
摘要:常用Action说明:String ADD_SHORTCUT_ACTION 动作:在系统中添加一个快捷方式。. “android.intent.action.ADD_SHORTCUT”String ALL_APPS_ACTION 动作:列举所有可用的应用。 输入:无。 “android.intent... 阅读全文
posted @ 2015-11-26 11:25 yangan 阅读(1124) 评论(0) 推荐(0)
摘要:1 Intent.ACTION_MAINString: android.intent.action.MAIN标识Activity为一个程序的开始。比较常用。Input:nothingOutput:nothing 2 Intent.Action_CALLStirng: android.inten... 阅读全文
posted @ 2015-11-26 11:20 yangan 阅读(529) 评论(0) 推荐(0)
摘要:首先声明只有在Linearlayout中,该属性才有效。之所以android:layout_weight会引起争议,是因为在设置该属性的同时,设置android:layout_width为wrap_content和match_parent会造成两种截然相反的效果。如下所示:[html] view p... 阅读全文
posted @ 2015-11-26 09:46 yangan 阅读(206) 评论(0) 推荐(0)
摘要:android.permission.ACCESS_NETWORK_STATE允许程序访问有关GSM网络信息(Allowsapplications to access information about networks) android.permission.ACCESS_WIFI_STATE允许... 阅读全文
posted @ 2015-11-19 10:27 yangan 阅读(2905) 评论(0) 推荐(0)
摘要:提供将要执行的action的额外信息,一般在隐式地启动activity时需要用到。常见的category如下:CATEGORY_ALTERNATIVE设置这个activity是否可以被认为是用户正在浏览的数据的一个可选择的actionCATEGORY_APP_BROWSER和ACTION_MAIN一... 阅读全文
posted @ 2015-11-16 09:32 yangan 阅读(1475) 评论(0) 推荐(0)