예제 #1
0
 protected void onCreate(Bundle savedInstanceState) {
   BroadcastUtil.removeProgressState();
   initAppState();
   super.onCreate(savedInstanceState);
   BitherApplication.hotActivity = this;
   setContentView(R.layout.activity_hot);
   initView();
   registerReceiver(
       broadcastReceiver, new IntentFilter(BroadcastUtil.ACTION_SYNC_BLOCK_AND_WALLET_STATE));
   registerReceiver(
       totalBitcoinBroadcastReceiver, new IntentFilter(BroadcastUtil.ACTION_TOTAL_BITCOIN_STATE));
   mPager.postDelayed(
       new Runnable() {
         @Override
         public void run() {
           initClick();
           mPager.postDelayed(
               new Runnable() {
                 @Override
                 public void run() {
                   Fragment f = getActiveFragment();
                   if (f instanceof Selectable) {
                     ((Selectable) f).onSelected();
                   }
                 }
               },
               100);
           mPager.postDelayed(
               new Runnable() {
                 @Override
                 public void run() {
                   showNewCount();
                 }
               },
               500);
           onNewIntent(getIntent());
           ServiceUtil.doMarkTimerTask(true);
         }
       },
       500);
   addNewPrivateKey();
   mPager.postDelayed(
       new Runnable() {
         @Override
         public void run() {
           if (ServiceUtil.localTimeIsWrong()) {
             DropdownMessage.showDropdownMessage(HotActivity.this, R.string.time_is_wrong);
           }
         }
       },
       2 * 1000);
 }
예제 #2
0
 @Override
 protected void onNewIntent(Intent intent) {
   deleteNotification();
   if (intent != null
       && intent.getExtras() != null
       && intent.getExtras().containsKey(BitherSetting.INTENT_REF.NOTIFICATION_ADDRESS)) {
     final String address =
         intent.getExtras().getString(BitherSetting.INTENT_REF.NOTIFICATION_ADDRESS);
     mPager.postDelayed(
         new Runnable() {
           @Override
           public void run() {
             if (mPager.getCurrentItem() != 1) {
               mPager.setCurrentItem(1, false);
             }
             Fragment fragment = getFragmentAtIndex(1);
             if (fragment != null && fragment instanceof HotAddressFragment) {
               ((HotAddressFragment) fragment).scrollToAddress(address);
             }
           }
         },
         400);
   }
 }