How do I open an Activity in button's onClick()?

后端 未结 2 754
南笙
南笙 2021-01-21 18:25

I have two Activitys, named App and Gallery.

App contains frontend buttons and functionalities, Gallery

相关标签:
2条回答
  • 2021-01-21 19:06

    if your Gallery.java is an activity you could start it by calling startActivity(new Intent(this, Gallery.class));

    0 讨论(0)
  • 2021-01-21 19:12

    Use an Intent

     Intent  intent  = new Intent(this,Gallery.class);
     intent.putExtra(<key>,<value>);
     startActivity(intent);
    
    0 讨论(0)
提交回复
热议问题