nanaten / Activity-Contract-Example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Activity-Contract-Example

This is a sample registerForActivityResult that replaces startActivityForResult.

From androidx.fragment:fragment-ktx:1.3.0-alpha04, the following method is deprecated: androidx.fragment:fragment-ktx:1.3.0-alpha04.

  • startActivityForResult
  • onActivityResult
  • requestPermissions
  • onRequestPermissionsResult

official source

The announcement says to use registerForActivityResult of ActivityResultContract instead.

Registering a callback for an Activity Result

Then, I summarized the usage of registerForActivityResult.

About


Languages

Language:Kotlin 100.0%