How to start an activity from a dialog in Android

后端 未结 7 1700
北海茫月
北海茫月 2021-01-11 12:20

I created a custom dialog and I\'d like to start a new activity when OK is clicked. How can I get the context to set it as first argument of my Intent constructor?

I

相关标签:
7条回答
  • 2021-01-11 12:58
    Intent i = new Intent(getBaseContext(), ItemSelection.class);
    

    This worked for me although the structure is different, there is no class for the dialog.

    0 讨论(0)
提交回复
热议问题