Added in API level 31

IncorrectContextUseViolation


public final class IncorrectContextUseViolation
extends Violation

java.lang.Object
   ↳ java.lang.Throwable
     ↳ android.os.strictmode.Violation
       ↳ android.os.strictmode.IncorrectContextUseViolation


Incorrect usage of Context, such as obtaining a UI service from non-UI Context instance.

Summary

Public constructors

IncorrectContextUseViolation(String message, Throwable originStack)

Inherited methods

Public constructors

IncorrectContextUseViolation

Added in API level 31
public IncorrectContextUseViolation (String message, 
                Throwable originStack)

Parameters
message String: This value cannot be null.

originStack Throwable: This value cannot be null.