RingtoneManager setType - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getCursor, inferStreamType, setIncludeDrm, setType
9
CodeRank
This code example shows how to use the following methods:getCursor, inferStreamType, setIncludeDrm, setType
7
CodeRank
This code example shows how to use the following methods:getCursor, inferStreamType, setIncludeDrm, setType
6
CodeRank
This code example shows how to use the following methods:getCursor, setIncludeDrm, setType
  class BuiltinToneCursor extends ToneCursor 
  { 
    private RingtoneManager mRingtoneManager;
    public BuiltinToneCursor(int ringtone_type) { 
      init(); 
      mRingtoneManager = new RingtoneManager(mContext);
      mRingtoneManager.setType(ringtone_type);
      mRingtoneManager.setIncludeDrm(true);
      mCursor = mRingtoneManager.getCursor();
    } 
    public Tone cacheTone(int position) {
      mCursor.moveToPosition(position);
      Tone tone = new Tone();
      tone.name = mCursor.getString(RingtoneManager.TITLE_COLUMN_INDEX);
      tone.uri = mRingtoneManager.getRingtoneUri(position);
      return tone;
    } 
  } 
 
  class MediaToneCursor extends ToneCursor 
6
CodeRank
This code example shows how to use the following methods:getRingtone, getRingtonePosition, setType
        final String s = settings.getRingtone();
        if ((s == null) || "".equals(s)) {
            return; 
        } 
 
        final RingtoneManager manager = new RingtoneManager(this);
        manager.setType(RingtoneManager.TYPE_ALL);
        ringtone = manager.getRingtone(manager.getRingtonePosition(Uri.parse(s)));
        if (ringtone == null) {
            return; 
        } 
 
        // TODO: AnnouncifySettings using ContentProvider 
        ringtone.setStreamType(new AnnouncifySettings(this).getStream());
        ringtone.play();
    } 
 
    protected void stopRingtone() { 
        if (ringtone != null) {
            ringtone.stop();
7
CodeRank
This code example shows how to use the following methods:getCursor, inferStreamType, setIncludeDrm, setType
6
CodeRank
This code example shows how to use the following methods:getCursor, inferStreamType, setIncludeDrm, setType
6
CodeRank
This code example shows how to use the following methods:getRingtoneUri, setType
	 
 
	public void soundPlay(int position){
		mMediaPlayer = new MediaPlayer();
		mMediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);
		RingtoneManager mRingtoneManager = new RingtoneManager(this);
		mRingtoneManager.setType(RINGTON_STREAMTYPE);
		Uri uri = mRingtoneManager.getRingtoneUri(position);
		try { 
			mMediaPlayer.setDataSource(this, uri);
		} catch (IllegalArgumentException e) {
			// TODO 自動生成された catch ブロック 
			e.printStackTrace();
		} catch (SecurityException e) {
			// TODO 自動生成された catch ブロック 
			e.printStackTrace();
		} catch (IllegalStateException e) {
			// TODO 自動生成された catch ブロック 
			e.printStackTrace();
		} catch (IOException e) {
5
CodeRank

Related RingtoneManager setType Questions & Answers:

setType Method Overview
Sets which type(s) of ringtones will be listed by this.
See Code Examples for other Android RingtoneManager Methods: