我正在使用Firebase制作android应用。首先,我使用电子邮件和密码登录。然后,我成功创建了房间。创建房间后,我想切换到交易场景。但是,当我使用startActivity方法切换到其他活动时,应用崩溃。我收到此错误。
handleWindowVisibility: no activity for token android.os.BinderProxy@e4f69f5
这是我的代码。
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.lobby);
room= new RoomData();
createRoom = (Button) findViewById(R.id.createroom);
}
createRoom.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
createRoom();
}
});
public void createRoom(){
roomsDatabase = FirebaseDatabase.getInstance().getReference("Rooms");
String roomId = roomsDatabase.push().getKey();
room.roomId = roomId;
Map<String, Object> roomDetails = new HashMap<>();
roomDetails.put("Player1",UserData.userId);
roomDetails.put("Player2","none");
roomDetails.put("Player1Ready",false);
roomDetails.put("Player2Ready",false);
roomsDatabase.child(room.roomId).updateChildren(roomDetails);
room.playerId = "Player1";
OpenListenRoom();
OpenListenInvites();
Intent i= new Intent(getApplicationContext(),Transaction.class);
startActivity(i);
}
我无法解决问题。我该怎么办?。