Beispiel #1
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   if (mRecevier != null) {
     unregisterReceiver(mRecevier);
   }
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.acty_activitiessharedetail);
   initData();
   initLayout();
   openReceiver();
 }
Beispiel #3
0
 @Override
 protected void onResume() {
   super.onResume();
   if (MessageCache.getUnreadCount(getContext()) == 0) {
     tv_unreadCount.setVisibility(View.INVISIBLE);
   } else {
     tv_unreadCount.setText(MessageCache.getUnreadCount(getContext()) + "");
     tv_unreadCount.setVisibility(View.VISIBLE);
   }
 }
Beispiel #4
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.acty_main);
   initData();
   initLayout();
   checkVerison();
   startPolling();
   openReceiver();
 }
Beispiel #5
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.acty_about);
   initData();
   initLayout();
   mReceiver =
       new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
           dialog.dismiss();
           try {
             if (intent.getIntExtra("versioncode", 0)
                 <= AndroidUtils.getAppVersionCode(getContext())) {
               toast("已经是最新版");
             }
           } catch (NameNotFoundException e) {
             e.printStackTrace();
             toast("检查版本失败");
           }
         }
       };
   registerReceiver(mReceiver, new IntentFilter(Constants.Action_Receive_VersionInfo));
 }