public class Ringtone extends Object
For ways of retrieving Ringtone
objects or to show a ringtone
picker, see RingtoneManager
.
RingtoneManager
Constructor and Description |
---|
Ringtone(Context context,
boolean allowRemote) |
Modifier and Type | Method and Description |
---|---|
int |
getStreamType()
Gets the stream type where this ringtone will be played.
|
String |
getTitle(Context context)
Returns a human-presentable title for ringtone.
|
Uri |
getUri() |
boolean |
isPlaying()
Whether this ringtone is currently playing.
|
void |
play()
Plays the ringtone.
|
void |
setStreamType(int streamType)
Sets the stream type where this ringtone will be played.
|
void |
setUri(Uri uri)
Set
Uri to be used for ringtone playback. |
void |
stop()
Stops a playing ringtone.
|
public Ringtone(Context context, boolean allowRemote)
public void setStreamType(int streamType)
streamType
- The stream, see AudioManager
.public int getStreamType()
AudioManager
.public String getTitle(Context context)
context
- A context used for querying.public void setUri(Uri uri)
Uri
to be used for ringtone playback. Attempts to open
locally, otherwise will delegate playback to remote
IRingtonePlayer
.public Uri getUri()
public void play()
public void stop()
public boolean isPlaying()