Ringtone stop - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Ringtone stop method.

This code example shows how to use the following methods:isPlaying, stop
            ringtone.play();
        } 
    } 
 
    private void stopAnyPlayingRingtone() { 
        if (defaultRingtone != null && defaultRingtone.isPlaying()) {
            defaultRingtone.stop();
        } 
        if (ringtoneManager != null) {
            ringtoneManager.stopPreviousRingtone();
        } 
    } 
} 
7
CodeRank
This code example shows how to use the following methods:isPlaying, play, stop
		builder.setSingleChoiceItems(getEntries(), getSelectedItem(), new OnClickListener() {
			@Override 
			public void onClick(final DialogInterface dialog, final int which) {
				setSelectedItem(which);
				final Ringtone ringtone = getSelectedRingtone();
				if (ringtone.isPlaying()) {
					ringtone.stop();
				} 
				ringtone.play();
			} 
		}); 
	} 
 
	private void loadRingtones(final Context context) {
		final RingtoneManager manager = new RingtoneManager(context);
		manager.setType(RingtoneManager.TYPE_NOTIFICATION);
		final Cursor cur = manager.getCursor();
		cur.moveToFirst();
		final int count = cur.getCount();
		mRingtones = new ArrayList<Ringtone>(count);
7
CodeRank
This code example shows how to use the following methods:isPlaying, stop
 
    public void term() 
        { 
        if (rt != null)
            { 
            if (rt.isPlaying())
                rt.stop();
            } 
 
        if (toast != null)
            toast.cancel();
        } 
 
    public void run () 
        { 
        String sText =(((lcv++ % 2) == 0)  ? "Help me!" : "I've fallen down!" );
        toast.setText(sText);
        toast.show();
        if (rt != null)
            rt.play();
6
CodeRank
This code example shows how to use the following methods:isPlaying, stop
        dialog.show();
        return this;
    } 
 
    private void stopAnyPlayingRingtone() { 
        if (defaultRingtone != null && defaultRingtone.isPlaying()) {
            defaultRingtone.stop();
        } 
        if (ringtoneManager != null) {
            ringtoneManager.stopPreviousRingtone();
        } 
    } 
} 
6
CodeRank
This code example shows how to use the following methods:isPlaying, play, stop
			boolean fromUser) {
	 
		if (!fromUser)
			return; 
		 
		if (mRingtone != null && !mRingtone.isPlaying())
			sampleOn(); 
 
		postVolumeChange(progress);
	} 
 
	private void postVolumeChange(int progress) {
		iLastVolume = progress;
		mHandler.removeCallbacks(null);
		mHandler.post(this);
		 
	} 
 
	@Override 
	public void onStartTrackingTouch(SeekBar seekBar) {

5
CodeRank
This code example shows how to use the following methods:isPlaying, stop
		dialog.show();
		return this;
	} 
 
	private void stopAnyPlayingRingtone() { 
		if (defaultRingtone != null && defaultRingtone.isPlaying()) {
			defaultRingtone.stop();
		} 
		if (ringtoneManager != null) {
			ringtoneManager.stopPreviousRingtone();
		} 
	} 
} 
5
CodeRank
This code example shows how to use the following methods:isPlaying, stop
		stop(); 
	} 
	 
	public void stop() 
	{ 
		if(r!=null&&r.isPlaying())
		r.stop();
	} 
	 
	 
} 
5
CodeRank
This code example shows how to use the following methods:isPlaying, stop
 
        activationLevel = LEVEL_NOT_ACTIVE;
        message = "";
 
        if(RemoteRingActivity.ringtone != null && RemoteRingActivity.audioManager != null) {
            if(ringtone.isPlaying()) {
                ringtone.stop();
                wasStopped = true;
            } 
            audioManager.setRingerMode(oldMode);
            audioManager.setStreamVolume(AudioManager.STREAM_RING, oldVolume, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
        } 
 
        if(RemoteRingActivity.alertDialog != null)
            RemoteRingActivity.alertDialog.dismiss();
        if(RemoteRingActivity._instance != null)
            RemoteRingActivity._instance.finish();
 
        return wasStopped;
    } 
5
CodeRank
This code example shows how to use the following methods:isPlaying, stop
		if(mWakeLock.isHeld()){
			mWakeLock.release();
		} 
 
		if(mRingtone!=null){
			if(mRingtone.isPlaying()){
				mRingtone.stop();
				mRingtone=null;
			} 
		} 
 
		super.onPause(); 
	} 
 
 
 
	private synchronized void enableKeyguard() { 
		if (mKeyguardLock != null) {
			mKeyguardLock.reenableKeyguard();
			mKeyguardLock = null;
5
CodeRank
This code example shows how to use the following methods:isPlaying, stop
			ringtone.play();
		} 
	} 
 
	private void stopAnyPlayingRingtone() { 
		if (defaultRingtone != null && defaultRingtone.isPlaying()) {
			defaultRingtone.stop();
		} 
		if (ringtoneManager != null) {
			ringtoneManager.stopPreviousRingtone();
		} 
	} 
} 
4
CodeRank

Related Ringtone stop Questions & Answers:

stop Method Overview
Stops a playing ringtone.
See Code Examples for other Android Ringtone Methods: