Holo风格的开源中国Android客户端——持续更新(1)
生活随笔
收集整理的這篇文章主要介紹了
Holo风格的开源中国Android客户端——持续更新(1)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
為什么80%的碼農(nóng)都做不了架構(gòu)師?>>>
一、圖片
首頁(yè)
??? ??????
登錄
???
二、關(guān)于登錄的幾個(gè)疑問(wèn)
????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。
關(guān)于這個(gè)警告,字面意思應(yīng)該是說(shuō):這是一個(gè)可以被外部訪問(wèn)的service,需要使用權(quán)限來(lái)限制外部訪問(wèn)。
網(wǎng)上查了些資料,給出的解釋如下:
1.1、添加一句話,限制外部訪問(wèn),那么自然就不需要權(quán)限了。
android:exported="false"1.2、聲明權(quán)限
先在<manifest>標(biāo)簽下加入:
<permission android:protectionLevel="normal" android:name="oem.permission.SENDMAIL"></permission> 然后在<receiver>標(biāo)簽下添加 android:permission="oem.permission.SENDMAIL"
2、登錄成功后發(fā)送廣播的作用
2.1、登錄成功
// 發(fā)送通知廣播 UIHelper.sendBroadCast(LoginDialog.this, user.getNotice());2.2、發(fā)送廣播代碼
/*** 發(fā)送通知廣播* * @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); }是用于更新內(nèi)容嗎?求高人指點(diǎn)。
?
轉(zhuǎn)載于:https://my.oschina.net/xsjayz/blog/139014
總結(jié)
以上是生活随笔為你收集整理的Holo风格的开源中国Android客户端——持续更新(1)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 刷题07
- 下一篇: 设计抗住千万级流量的架构思路(转)