java.lang.IllegalStateException: No activity

前端 未结 5 908
自闭症患者
自闭症患者 2020-12-09 19:53

I\'m building an Android app for which I\'d like my first activity to be composed of 2 tabs, one for the user\'s profile, and one for the friends\' activity. For these tabs,

5条回答
  •  时光说笑
    2020-12-09 20:36

    I got this error too. Finally, found out that I was overriding the methods onResume() onStop() incorrectly

    @Override
    protected void onResume() {
        super.onResume();
        initilizeMap();
    }
    @Override
    protected void onStop() {
        super.onResume();
        finish();
    }
    

    Changed it to

     @Override
    protected void onResume() {
        super.onResume();
        initilizeMap();
    }
    @Override
    protected void onStop() {
        super.onStop();
        finish();
    }
    

    So Silly Mistake :P

提交回复
热议问题