Error: onActivityResult overrides nothing

前端 未结 1 1371
说谎
说谎 2021-02-03 21:39

I am programming a speech recognition app in Kotlin for Android.

class MainActivity : AppCompatActivity() {
    public override fun onCreate(savedInstanceState:         


        
相关标签:
1条回答
  • 2021-02-03 22:18

    Replace

    override fun onActivityResult(requestCode:Int, resultCode:Int, data:Intent)
    

    With below code, to make Intent object nullable.

    override fun onActivityResult(requestCode:Int, resultCode:Int, data:Intent?)
    

    As Intent is declared nullable in parent Activity class. Here is the sample code:

    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) 
    
    0 讨论(0)
提交回复
热议问题