Questions tagged «savestate»

7
请如何使用onSavedInstanceState示例
当涉及到保存状态时,我感到困惑。因此,我知道onSaveInstanceState(Bundle)活动即将被销毁时会调用它。但是,如何存储您的信息并将其恢复到原始状态onCreate(Bundle savedInstanceState)?我不知道该捆绑包将如何还原信息。如果有人可以提供示例,将很有帮助。开发人员指南无法很好地解释这一点。 public class Conversation extends Activity { private ProgressDialog progDialog; int typeBar; TextView text1; EditText edit; Button respond; private String name; private String textAtView; private String savedName; public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.dorothydialog); text1 = (TextView)findViewById(R.id.dialog); edit = (EditText)findViewById(R.id.repsond); respond = (Button)findViewById(R.id.button01); if(savedInstanceState != null){ savedInstanceState.get(savedName); text1.setText(savedName); } else{ …
110 android  savestate 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.