Release Memory of Particular Activity when it is Destroyed

前端 未结 7 1570
说谎
说谎 2020-12-15 05:38

I have a launcher Activity that load and resize big bitmap as it\'s background when it opens.

Whenever hit the back button, the Activity is

7条回答
  •  情歌与酒
    2020-12-15 06:15

    add this to your code

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event)
    {
        if ((keyCode == KeyEvent.KEYCODE_BACK))
        {
            finish();
        }
        return super.onKeyDown(keyCode, event);
    }
    

提交回复
热议问题