android 四种启动模式
移动开发
2018-08-14 00:08:29
阅读次数: 0
1.standard模式
下面四种对应情况下创建一个新的activity时,生命流程会调用NewIntent方法
2.singletop模式:
![](https://img-blog.csdn.net/20180812163724801?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VtbW1zdXBlcmRhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
当处于栈顶的时候,就会调用NewIntent;
![](https://img-blog.csdn.net/20180812163756531?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VtbW1zdXBlcmRhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
3.singletask
![](https://img-blog.csdn.net/20180812163826556?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VtbW1zdXBlcmRhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
当activity在栈中就会调用NewIntent
![](https://img-blog.csdn.net/2018081216384187?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VtbW1zdXBlcmRhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
4.singleinstance模式:
![](https://img-blog.csdn.net/20180812163943445?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VtbW1zdXBlcmRhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
当activity被创建的时候,NewIntent就会被调用
转载自blog.csdn.net/emmmsuperdan/article/details/81607740