Holo风格的开源中国Android客户端——持续更新(1)
生活随笔
收集整理的這篇文章主要介紹了
Holo风格的开源中国Android客户端——持续更新(1)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
為什么80%的碼農都做不了架構師?>>>
一、圖片
首頁
??? ??????
登錄
???
二、關于登錄的幾個疑問
????1、Manifest文件的警告:
<receiver android:name=".ui.BroadCast"><intent-filter><action android:name="net.oschina.app.action.APPWIDGET_UPDATE" /></intent-filter> </receiver>
警告:Exported receiver does not require permission。
關于這個警告,字面意思應該是說:這是一個可以被外部訪問的service,需要使用權限來限制外部訪問。
網上查了些資料,給出的解釋如下:
1.1、添加一句話,限制外部訪問,那么自然就不需要權限了。
android:exported="false"1.2、聲明權限
先在<manifest>標簽下加入:
<permission android:protectionLevel="normal" android:name="oem.permission.SENDMAIL"></permission> 然后在<receiver>標簽下添加 android:permission="oem.permission.SENDMAIL"
2、登錄成功后發送廣播的作用
2.1、登錄成功
// 發送通知廣播 UIHelper.sendBroadCast(LoginDialog.this, user.getNotice());2.2、發送廣播代碼
/*** 發送通知廣播* * @param context* @param notice*/ public static void sendBroadCast(Context context, Notice notice) {if (!((AppContext) context.getApplicationContext()).isLogin()|| notice == null)return;Intent intent = new Intent("net.oschina.app.action.APPWIDGET_UPDATE");intent.putExtra("atmeCount", notice.getAtmeCount());intent.putExtra("msgCount", notice.getMsgCount());intent.putExtra("reviewCount", notice.getReviewCount());intent.putExtra("newFansCount", notice.getNewFansCount());context.sendBroadcast(intent); }是用于更新內容嗎?求高人指點。
?
轉載于:https://my.oschina.net/xsjayz/blog/139014
總結
以上是生活随笔為你收集整理的Holo风格的开源中国Android客户端——持续更新(1)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 刷题07
- 下一篇: Android中Dialog与Dialo