Android學習筆記(二)--iparty登陸介面

來源:互聯網
上載者:User

標籤:android   c   style   class   blog   code   

  開啟應用,判斷是否第一次使用。

 1     private void beforeInitMenu() { 2         AppContext appContext = (AppContext) getApplicationContext(); 3  4         if (appContext.isFirstLogin()) { 5             // 第一次啟動 6             //如果第一次啟動,出現5張引導圖片。 7             Intent intent = new Intent(this, GuideActivity.class); 8             startActivity(intent); 9         } else if (!appContext.isLogin()) {10             // 檢查是否登陸11             UIHelper.showLoginPage(this);12         } else {13             // 登陸聊天伺服器14             OpenfireLoginTask task = new OpenfireLoginTask(this,15                     appContext.getLoginUid() + "", appContext.getLoginInfo()16                             .getPwd());17             task.execute();18         }19 20         // 網路連接判斷21         if (!appContext.isNetworkConnected()) {22             T.showLong(this, R.string.network_not_connected);23         }24 25         // 開啟百度推送服務26         // 以apikey的方式登入,一般放在主Activity的onCreate中27         PushManager.startWork(getApplicationContext(),28                 PushConstants.LOGIN_TYPE_API_KEY,29                 ApiKeyUtil.getMetaValue(this, "api_key"));30 31         // 檢查新版本32         if (appContext.isCheckUp()) {33             UpdateManager.getUpdateManager().checkAppUpdate(this, false);34         }35 36         // 註冊訊息接收廣播37         IntentFilter filter = new IntentFilter();38         filter.addAction(OpenfireConstant.NEW_MESSAGE_ACTION);39         registerReceiver(receiver, filter);40 41     }

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.