IT. Expert System.

Android Reference

RingtoneManager


android.media

Class RingtoneManager



  • public class RingtoneManager
    extends Object
    RingtoneManager provides access to ringtones, notification, and other types of sounds. It manages querying the different media providers and combines the results into a single cursor. It also provides a Ringtone for each ringtone. We generically call these sounds ringtones, however the TYPE_RINGTONE refers to the type of sounds that are suitable for the phone ringer.

    To show a ringtone picker to the user, use the ACTION_RINGTONE_PICKER intent to launch the picker as a subactivity.

    See Also:
    Ringtone
See Also:
ACTION_RINGTONE_PICKER, Constant Field Values
  • ID_COLUMN_INDEX

    public static final int ID_COLUMN_INDEX
    The column index (in the cursor returned by getCursor() for the row ID.
    See Also:
    Constant Field Values
  • TITLE_COLUMN_INDEX

    public static final int TITLE_COLUMN_INDEX
    The column index (in the cursor returned by getCursor() for the title.
    See Also:
    Constant Field Values
  • URI_COLUMN_INDEX

    public static final int URI_COLUMN_INDEX
    The column index (in the cursor returned by getCursor() for the media provider's URI.
    See Also:
    Constant Field Values
  • Constructor Detail

    • RingtoneManager

      public RingtoneManager(Activity activity)
      Constructs a RingtoneManager. This constructor is recommended as its constructed instance manages cursor(s).
      Parameters:
      activity - The activity used to get a managed cursor.
    • RingtoneManager

      public RingtoneManager(Context context)
      Constructs a RingtoneManager. The instance constructed by this constructor will not manage the cursor(s), so the client should handle this itself.
      Parameters:
      context - The context to used to get a cursor.
  • Method Detail

    • inferStreamType

      public int inferStreamType()
      Infers the playback stream type based on what type of ringtones this manager is returning.
      Returns:
      The stream type.
    • setStopPreviousRingtone

      public void setStopPreviousRingtone(boolean stopPreviousRingtone)
      Whether retrieving another Ringtone will stop playing the previously retrieved Ringtone.

      If this is false, make sure to Ringtone.stop() any previous ringtones to free resources.

      Parameters:
      stopPreviousRingtone - If true, the previously retrieved Ringtone will be stopped.
    • stopPreviousRingtone

      public void stopPreviousRingtone()
      Stops playing the last Ringtone retrieved from this.
    • getIncludeDrm

      public boolean getIncludeDrm()
      Returns whether DRM ringtones will be included.
      Returns:
      Whether DRM ringtones will be included.
      See Also:
      setIncludeDrm(boolean)
    • setIncludeDrm

      public void setIncludeDrm(boolean includeDrm)
      Sets whether to include DRM ringtones.
      Parameters:
      includeDrm - Whether to include DRM ringtones.
    • getRingtone

      public Ringtone getRingtone(int position)
      Gets a Ringtone for the ringtone at the given position in the Cursor.
      Parameters:
      position - The position (in the Cursor) of the ringtone.
      Returns:
      A Ringtone pointing to the ringtone.
    • getRingtoneUri

      public Uri getRingtoneUri(int position)
      Gets a Uri for the ringtone at the given position in the Cursor.
      Parameters:
      position - The position (in the Cursor) of the ringtone.
      Returns:
      A Uri pointing to the ringtone.
    • getRingtonePosition

      public int getRingtonePosition(Uri ringtoneUri)
      Gets the position of a Uri within this RingtoneManager.
      Parameters:
      ringtoneUri - The Uri to retreive the position of.
      Returns:
      The position of the Uri, or -1 if it cannot be found.
    • getValidRingtoneUri

      public static Uri getValidRingtoneUri(Context context)
      Returns a valid ringtone URI. No guarantees on which it returns. If it cannot find one, returns null.
      Parameters:
      context - The context to use for querying.
      Returns:
      A ringtone URI, or null if one cannot be found.
    • getRingtone

      public static Ringtone getRingtone(Context context,
                         Uri ringtoneUri)
      Returns a Ringtone for a given sound URI.

      If the given URI cannot be opened for any reason, this method will attempt to fallback on another sound. If it cannot find any, it will return null.

      Parameters:
      context - A context used to query.
      ringtoneUri - The Uri of a sound or ringtone.
      Returns:
      A Ringtone for the given URI, or null.
    • isDefault

      public static boolean isDefault(Uri ringtoneUri)
      Returns whether the given Uri is one of the default ringtones.
      Parameters:
      ringtoneUri - The ringtone Uri to be checked.
      Returns:
      Whether the Uri is a default.
    • getDefaultUri

      public static Uri getDefaultUri(int type)
      Returns the Uri for the default ringtone of a particular type. Rather than returning the actual ringtone's sound Uri, this will return the symbolic Uri which will resolved to the actual sound when played.
      Parameters:
      type - The ringtone type whose default should be returned.
      Returns:
      The Uri of the default ringtone for the given type.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 327 / . Delta: 0.05611 с