OnActivityResult method is deprecated, what is the alternative?

前端 未结 5 559
情话喂你
情话喂你 2021-01-01 10:33

Recently I faced the onActivtyResult is deprecated. what should we do for handle it?

any alternative introduced for that?

5条回答
  •  一整个雨季
    2021-01-01 10:59

    It seems that onActivityResult is deprecated in the super class but you did not mention the super class name and compileSdkVersion here in your question.

    In Java and Kotlin every class or method could be marked as deprecated simply by adding @Deprecated to it so check your super class you may extend a wrong class.

    When a class is deprecated all of its methods are deprecated too.

    To see a quick solution click on deprecated method and press Ctrl+Q in Android studio to see documentation of method there should be a solution for it.


    In my project using androidx and API 29 as compileSdkVersion, this method is NOT deprecated in activities and fragments

提交回复
热议问题