@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(); }
@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); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.acty_main); initData(); initLayout(); checkVerison(); startPolling(); openReceiver(); }
@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)); }