{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

SetTargetFragmentUsageViolation

Added in 1.4.0

public final class SetTargetFragmentUsageViolation extends TargetFragmentUsageViolation

java.lang.Object
   ↳ kotlin.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ androidx.fragment.app.strictmode.Violation
           ↳ androidx.fragment.app.strictmode.TargetFragmentUsageViolation
             ↳ androidx.fragment.app.strictmode.SetTargetFragmentUsageViolation

See FragmentStrictMode.Policy.Builder.detectTargetFragmentUsage.

Summary

Public methods

final int

Gets the request code that was passed in the call causing the Violation.

final @NonNull Fragment

Gets the target Fragment that was being set in the call causing the Violation.

Inherited methods

From kotlin.Throwable
From androidx.fragment.app.strictmode.Violation
final @NonNull Fragment

Gets the Fragment causing the Violation.

Public methods

getRequestCode

Added in 1.4.0
public final int getRequestCode()

Gets the request code that was passed in the call causing the Violation.

getTargetFragment

Added in 1.4.0
public final @NonNull Fragment getTargetFragment()

Gets the target Fragment that was being set in the call causing the Violation.