今天的几个问题
1, activity被回收,如何恢复当前状态。
当A跳转到B,在这之间A又被回收了,当B返回的时候,如何恢复A原先的状态。
protected void onCreate(Bundle savedInstanceState)
上面的这个onCreate函数带的Bundle参数,就是当activity意外被回收的时候可以保存的一些状态。
Android activity也有一个函数在被回收的时候调用。即:onSaveInstanceState()
@Override
protected void onSaveInstanceState(Bundle outState) {
// TODO Auto-generated method stub
super.onSaveInstanceState(outState);
}
2, NDK的作用
很多app都使用NDK,虽然很多操作用java也可以完成,但是为了性能和安全,都会选择ndk进行开发;
-
very large code base in C++, which is used also for versions on iPhones and Winrt, and also Windows CE/Desktop. It was developer for years, fixed, tested by lots of users.
-
its harder for hackers to learn what your code is doing, and to break it. But not impossible.
3, content provider机制
之前程序中没有写过content provider,对这个机制确实不太了解。占个坑以后再来补充。
4, broadcast注册区别
在代码中注册和在xml文件中注册,在xml文件中注册为永久的。那么在代码中注册是否需要释放或者注销这个注册。
后面继续补充
2015-1-31