App always starts fresh from root activity instead of resuming background state (Known Bug)

前端 未结 5 1886
庸人自扰
庸人自扰 2020-11-28 22:00

I am facing exactly the problem mentioned in these links:

http://code.google.com/p/android/issues/detail?id=2373

http://groups.google.com/group/android-devel

5条回答
  •  半阙折子戏
    2020-11-28 22:40

        @Override 
    protected void onCreate(Bundle savedInstanceState) { 
        super.onCreate(savedInstanceState); 
        if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) { 
            // Activity was brought to front and not created, 
            // Thus finishing this will get us to the last viewed activity 
            finish(); 
            return; 
        } 
    
        // Regular activity creation code... 
    } 
    

提交回复
热议问题