Get default ringtone uri/ Uri String |
Uri sound = Ringtonemanager.getdefaulturi (type); (type = Ringtonemanager.type_ringtone or ringtonemanager.type_notification or ringtonemanager.type_alarm The same as below) |
Get ringtone uri/ Uri string |
String getringtoneuripath (int type,int pos) { Ringtonemanager manager = new Ringtonemanager (mcontext); Manager.settype (type); //workaround to create mcusor inside manager, or raise a segamentation fault whil E invoking Getringtoneuri, below methods same too Cursor cursor = manager.getcursor (); Uri uri = Manager.getringtoneuri (POS); return uri==null null:uri.toString (); } |
Get ringtone Title |
list<string> getringtonetitlelist (int type) { list<string> Resarr = new arraylist<string> (); Ringtonemanager manager = new Ringtonemanager (mcontext); Manager.settype (type); cursor cursor = manager.getcursor (); if (Cursor.movetofirst ()) { do{ Resarr.add (cursor.getstring (Ringtonemanager.title_column_index)); }while (Cursor.movetonext ()); } return Resarr; } |
Gets the specified type of Specify entry ringtone Action class |
Ringtone getringtone (int type,int pos) { Ringtonemanager manager = new Ringtonemanager (mcontext); Manager.settype (type); Return Manager.getringtone (POS); } |
Gets all of the specified types Ringtone action list |
list<ringtone> getringtonelist (int type) { list<ringtone> Resarr = new arraylist<ringtone> (); Ringtonemanager manager = new Ringtonemanager (mcontext); Manager.settype (type); cursor cursor = manager.getcursor (); int count = Cursor.getcount (); for (int i = 0; i < count; i + +) { Resarr.add (Manager.getringtone (i)); } return Resarr; } |
Android Ringtonemanager ringtone Manager