我的recyclerview中有一个AutoCompleteTextView,我想在触摸后退按钮后保留建议。有人能帮助我吗?
谢谢,
答案 0 :(得分:-1)
使用savedInstanceState但是,取决于您需要多长时间保存数据?你以后对数据做了什么?...你知道共享偏好吗?
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
...
if (savedInstanceState != null) {
//Restore the fragment's state here
}
}
...
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
//Save the fragment's state here
}