Hasan Altınbaş
Hasan Altınbaş

Reputation: 151

Android app crashes when I use startActivity method, handleWindowVisibility: no activity for token android.os.BinderProxy@e4f69f5

I am making android app by using Firebase. Firstly I login with email and password. Then I create room successfully. I want to switch to the transaction scene after I create room. Hovewer, when I use startActivity method to switch to the other activity, app crashes. I get this error.

handleWindowVisibility: no activity for token android.os.BinderProxy@e4f69f5

This is my code.

  @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);

}

I couldn't solve the problem. What should I do?.

Upvotes: 2

Views: 3264

Answers (1)

Related Questions