2012年4月28日
摘要: BroadcastReceiver通常需要向用户传达发生的某件事或状态,可以使用通知栏通知提醒用户。创建通知的过程:1、创建一个合适的通知2、获得通知管理器的权限3、向通知管理器发送通知创建通知时,需要包含以下几个部分:1、要显示的图标2、显示的提示文本3、传送它的时间然后使用Context获取一个名为Context.NOTIFICATION_SERVICE的系统服务来获取到通知管理器,如下所示://Get the notification manager String ns = Context.NOTIFICATION_SERVICE; NotificationManager nm = (N 阅读全文
posted @ 2012-04-28 15:17 lepfinder 阅读(659) 评论(0) 推荐(0) 编辑
摘要: 一、intent大全:1.从google搜索内容Intent intent = new Intent();intent.setAction( Intent.ACTION_WEB_SEARCH );intent.putExtra( SearchManager.QUERY, "红超的吾记之谈" )//搜索内容startActivity( intent );2.浏览网页Uri uri = Uri.parse( "http://wzhnsc.blogspot.com/" );Intent it = new Intent( Intent.ACTION_VIEW, 阅读全文
posted @ 2012-04-28 14:56 lepfinder 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 如下图所示,点击menu右面的broadcast会发送一条广播,广播接受者接受信息后,打印一些调试信息。下面看代码:布局文件layout/main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_ 阅读全文
posted @ 2012-04-28 14:54 lepfinder 阅读(658) 评论(0) 推荐(0) 编辑
摘要: 演示本地服务的使用方法。布局文件,包含两个按钮,一个启动服务,一个终止服务。<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height=&quo 阅读全文
posted @ 2012-04-28 10:08 lepfinder 阅读(449) 评论(0) 推荐(0) 编辑