当我关闭活动然后重新打开它时,如何让文本视图中的内容留在那里?
public class ViewOffense extends Activity {
EditOffense eo = new EditOffense();
List<String> rosterLog;
List<String> oneRow;
Bundle bundle;
static String selection;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.viewoffense);
bundle = this.getIntent().getExtras();
if (bundle != null) {
String selection = bundle.getString("key");
TextView textview = (TextView) findViewById(R.id.textView2);
textview.setText(selection);
}
}
}