Android CountDownTimer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android CountDownTimer class.

This code example shows how to use the following methods:start
			public void onTick(long millisUntilFinished) {
				 
			} 
			 
		}; 
		blockTimer.start();
	} 
	 
	private void invalidateBlocks(ArrayList<Rect> rects){
		 
		for (int i = 0; i < rects.size(); i++){
			Rect block = rects.get(i);
			invalidate(block);
		} 
		 
		rects.clear();
		 
			 
	} 
	 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:cancel
		    	setAlarm(true); 
		    	alarmSet=true;
		    }else if(didUserConfirmed.equals("true")){
		    	bg.interrupt();
		    	bg2.interrupt();
		    	timer.cancel();
		    	} 
		    } 
 
		     
		     
		   
	  } 
     
     
    public boolean compareLong(double sourceLat, double sourceLng){
    	 
    	//load destination coords 
    	String lng= LoadPreferences("lng");
     	String lat = LoadPreferences("lat");
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:start
        public void onReadyForSpeech(Bundle params)
        { 
            if (Build.VERSION.SDK_INT >= 16);//Build.VERSION_CODES.JELLY_BEAN)
            { 
                mIsCountDownOn = true;
                mNoSpeechCountDown.start();
                mAudioManager.setStreamMute(AudioManager.STREAM_SYSTEM, false);
            } 
            Log.d("TESTING: SPEECH SERVICE", "onReadyForSpeech"); //$NON-NLS-1$
        } 
 
        @Override 
        public void onResults(Bundle results)
        { 
        	ArrayList<String> data = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
			Log.d(TAG, (String) data.get(0));
				 
			if (data.get(0).contentEquals("ícaro")) {
 
				 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:cancel
	public boolean onOptionsItemSelected(MenuItem item) 
	{ 
		switch (item.getItemId())
		{ 
			case android.R.id.home:
				timer.cancel();
				Intent i = new Intent(getApplicationContext(),
 						MenuActivity.class); 
				i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
 				startActivity(i);
 				Log.d("GameAct", "activity started");
 				return true; 
 			default: 
 				return super.onOptionsItemSelected(item);
		} 
	} 
		 
	public void onClick(View v) 
	{ 
		// TODO Auto-generated method stub 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:start
This code example shows how to use the following methods:start
					timeLabel.setText(String.format("%.1f", (float) (System.currentTimeMillis() - startTime) / 1000) + " / " + setTime + " s");
					 
					if (vibratorToggled)
						v.vibrate(vibrateShort);
 
					activeTimer.start();
				} 
			} 
		}; 
 
		setProgressBar.setProgress(0);
		setProgressBar.setSecondaryProgress(0);
		setSpinner.setEnabled(false);
		startTime = System.currentTimeMillis();
		activeTimer.start();
		setDescriptionLabel.setText("Set: " + String.valueOf(activeTime) + "/" + String.valueOf(passiveTime) + " x" + String.valueOf(setRepetitions));
		repetitionCountLabel.setText("Completed repetitions: " + String.valueOf(repetitionCount));
		startSet.setText("Stop");
		inProgress = true;
		 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:start
			public void onTick(long millisUntilFinished) {
				 
			} 
			 
		}; 
		blockTimer.start();
	} 
	 
	private void invalidateBlocks(ArrayList<Rect> rects){
		 
		for (int i = 0; i < rects.size(); i++){
			Rect block = rects.get(i);
			invalidate(block);
		} 
		 
		rects.clear();
		 
			 
	} 
	 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:cancel
     * @brief stoppt gegebenen Timer 
     * @param CountDownTimer timer 
      */ 
    private void stopTimer(CountDownTimer timer){
        if (timer != null) {
            timer.cancel();
            timer = null;
        } 
    } 
    /** 
     * @brief stoppt Sound 
     * @param MediaPlayer player 
      */ 
    private void stopSound(MediaPlayer player){
        try { 
            if (player != null) {
                if (player.isPlaying()) {
                    player.stop();
                } 
                player.release();
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:cancel
                    { 
                        // Need to call stopVoiceRecognition here when the app 
                        // change orientation or close with headset still turns on. 
                         mBluetoothHeadset.stopVoiceRecognition(mConnectedHeadset); 
                         unregisterReceiver(mHeadsetBroadcastReceiver); 
                         mCountDown.cancel(); 
                    } 
                    mBluetoothAdapter.closeProfileProxy(BluetoothProfile.HEADSET, mBluetoothHeadset); 
                } 
                Log.d(TAG, "onDestroy"); //$NON-NLS-1$ 
            } 
 
            @SuppressLint("NewApi") 
			protected BluetoothProfile.ServiceListener mHeadsetProfileListener = new BluetoothProfile.ServiceListener() 
            { 
 
                /** 
                 * This method is never called, even when we closeProfileProxy on onPause. 
                 * When or will it ever be called??? 
                 */ 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:start
				updateLeftTime(0); 
				updateStatusView(); 
				updateMoneyView(); 
			} 
		}; 
		timer.start();
	} 
	 
	private String getProgressData(int max, int current) {
		return (current * 100 / max) + "%";
	} 
	 
	private void drawUI() { 
		setViewStyle(); 
		createPreviewBitMap(); 
		createToolButtons(); 
		createDescription(); 
		createProgress(); 
	} 
	 
3
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android CountDownTimer Questions & Answers:

See Code Examples for Android CountDownTimer Methods: