Cannot resolve method startActivity()

后端 未结 4 714
天命终不由人
天命终不由人 2021-02-07 09:08

I\'m new to the android development and having a bit of a problem changing activities. I am trying to change activities from within a method but I am getting the error can

4条回答
  •  忘了有多久
    2021-02-07 10:00

    you can also pass messages

     Intent i = new Intent( getContext(),Chat.class);
                i.putExtra("id",user.id);
                i.putExtra("name",user.name);
                getContext().startActivity(i);
    

提交回复
热议问题