Added in API level 19

Threads


class Threads : Telephony.ThreadsColumns
kotlin.Any
   ↳ android.provider.Telephony.Threads

Helper functions for the "threads" table used by MMS and SMS. Thread IDs are determined by the participants in a conversation and can be used to match both SMS and MMS messages. To avoid issues where applications might cache a thread ID, the thread ID of a deleted thread must not be reused to point at a new thread.

Summary

Constants
static Int

Thread type: broadcast thread.

static Int

Thread type: common thread.

Inherited constants
Public methods
static Long
getOrCreateThreadId(context: Context!, recipient: String!)

This is a single-recipient version of getOrCreateThreadId.

static Long
getOrCreateThreadId(context: Context!, recipients: MutableSet<String!>!)

Given a set of recipients return its thread ID.

Properties
static Uri!

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

static Uri!

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

Constants

BROADCAST_THREAD

Added in API level 19
static val BROADCAST_THREAD: Int

Thread type: broadcast thread.

Value: 1

COMMON_THREAD

Added in API level 19
static val COMMON_THREAD: Int

Thread type: common thread.

Value: 0

Public methods

getOrCreateThreadId

Added in API level 23
static fun getOrCreateThreadId(
    context: Context!,
    recipient: String!
): Long

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.

getOrCreateThreadId

Added in API level 23
static fun getOrCreateThreadId(
    context: Context!,
    recipients: MutableSet<String!>!
): Long

Given a set of recipients return its thread ID.

If a thread exists containing the provided participants, return its thread ID. Otherwise, this will create a new thread containing the provided participants and return its ID.

Properties

CONTENT_URI

Added in API level 19
static val CONTENT_URI: Uri!

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

OBSOLETE_THREADS_URI

Added in API level 19
static val OBSOLETE_THREADS_URI: Uri!

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