Added in API level 37

WrongThreadException

public final class WrongThreadException
extends RuntimeException

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ java.lang.WrongThreadException


Thrown to indicate that a method has been called on the wrong thread.

Summary

Public constructors

WrongThreadException()

Constructs a WrongThreadException with no detail message.

WrongThreadException(String s)

Constructs a WrongThreadException with the given detail message.

WrongThreadException(String message, Throwable cause)

Constructs a WrongThreadException with the given detail message and cause.

WrongThreadException(Throwable cause)

Constructs a WrongThreadException with the given cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Inherited methods

Public constructors

WrongThreadException

Added in API level 37
public WrongThreadException ()

Constructs a WrongThreadException with no detail message.

WrongThreadException

Added in API level 37
public WrongThreadException (String s)

Constructs a WrongThreadException with the given detail message.

Parameters
s String: the String that contains a detailed message, can be null

WrongThreadException

Added in API level 37
public WrongThreadException (String message, 
                Throwable cause)

Constructs a WrongThreadException with the given detail message and cause.

Parameters
message String: the detail message, can be null

cause Throwable: the cause, can be null

WrongThreadException

Added in API level 37
public WrongThreadException (Throwable cause)

Constructs a WrongThreadException with the given cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Parameters
cause Throwable: the cause, can be null