คำถามติดแท็ก savestate

7
วิธีใช้ตัวอย่าง onSavedInstanceState
ฉันสับสนเมื่อต้องบันทึกสถานะ ดังนั้นฉันจึงรู้ว่านั่นonSaveInstanceState(Bundle)เรียกว่าเมื่อกิจกรรมกำลังจะถูกทำลาย แต่คุณจะเก็บข้อมูลของคุณไว้ในนั้นและทำให้กลับสู่สภาพเดิมได้onCreate(Bundle savedInstanceState)อย่างไร? ฉันไม่เข้าใจว่าชุดข้อมูลนี้จะคืนค่าข้อมูลอย่างไร จะเป็นประโยชน์ถ้ามีคนยกตัวอย่างให้ คู่มือ Dev ไม่สามารถอธิบายเรื่องนี้ได้ดีนัก 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); …
110 android  savestate 
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.