Android APIs
public static final class

Telephony.Threads

extends Object
implements Telephony.ThreadsColumns
java.lang.Object
   ↳ android.provider.Telephony.Threads

Class Overview

Helper functions for the "threads" table used by MMS and SMS.

Summary

Constants
int BROADCAST_THREAD Thread type: broadcast thread.
int COMMON_THREAD Thread type: common thread.
[Expand]
Inherited Constants
From interface android.provider.Telephony.ThreadsColumns
From interface android.provider.BaseColumns
Fields
public static final Uri CONTENT_URI The content:// style URL for this table, by conversation.
public static final Uri OBSOLETE_THREADS_URI The content:// style URL for this table, for obsolete threads.
Public Methods
static long getOrCreateThreadId(Context context, String recipient)
This is a single-recipient version of getOrCreateThreadId.
static long getOrCreateThreadId(Context context, Set<String> recipients)
Given the recipients list and subject of an unsaved message, return its thread ID.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int BROADCAST_THREAD

Added in API level 19

Thread type: broadcast thread.

Constant Value: 1 (0x00000001)

public static final int COMMON_THREAD

Added in API level 19

Thread type: common thread.

Constant Value: 0 (0x00000000)

Fields

public static final Uri CONTENT_URI

Added in API level 19

The content:// style URL for this table, by conversation.

public static final Uri OBSOLETE_THREADS_URI

Added in API level 19

The content:// style URL for this table, for obsolete threads.

Public Methods

public static long getOrCreateThreadId (Context context, String recipient)

Added in API level 23

This is a single-recipient version of getOrCreateThreadId. It's convenient for use with SMS messages.

Parameters
context Context: the context object to use.
recipient String: the recipient to send to.
Returns
long

public static long getOrCreateThreadId (Context context, Set<String> recipients)

Added in API level 23

Given the recipients list and subject of an unsaved message, return its thread ID. If the message starts a new thread, allocate a new thread ID. Otherwise, use the appropriate existing thread ID.

Find the thread ID of the same set of recipients (in any order, without any additions). If one is found, return it. Otherwise, return a unique thread ID.

Parameters
context Context
recipients Set
Returns
long