0
我有一個按鈕,點擊裏面的時候改變它的文本的下一次運行。保持一個按鈕內部的文本應用
<Button android:id="@+id/timelinebtn"
android:text="Button1"
android:background="@android:color/transparent"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:padding="5dp" />
我在我的應用程序的一些其他用戶可點擊按鈕,並根據他們點擊什麼,這個按鈕內的文本(在第一個「Button1的」)的變化與代碼中的一些其他文本:
button1.setText("Changed the text to something other.");
我的問題是,如何保存該按鈕在程序下一次運行時顯示的最後文本。再次 讓它多一點明確的 - 當我關閉程序,如何按鈕可以保存裏面的文字,直到應用程序的下一次運行。
也許你應該閱讀http://developer.android.com/guide/topics/data/data-storage.html#pref – hovanessyan