質問編集履歴

1

説明を追加しました。

2020/08/26 07:25

投稿

android_app_tw
android_app_tw

スコア4

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,10 @@
1
- 現在、Android Studioで、入力フォームアプリを開発しています。
1
+ 現在、Android Studioで、年齢と名前を入力するアプリを開発しています。
2
-
2
+
3
- 入力フォームに入力されたテキストを、アプリを閉じても維持したいと考えています。
3
+ 入力フォームに入力された年齢と名前を、アプリを閉じて、その後アプリを再起動させた際に、閉じる前に入力したテキストを表示させたままにしたいと考えています。
4
+
5
+ ボタンを押して、テキストを保存するところまでできたのですが、その後の処理の仕方がいまいちわかりません。
6
+
7
+ どのような形でも良いので、その後のプログラムを教えていただけると幸いです。
4
8
 
5
9
  今できているプログラムは、こちらです。
6
10
 
@@ -102,6 +106,102 @@
102
106
 
103
107
 
104
108
 
109
+ Activity_main
110
+
111
+ <TextView
112
+
113
+ android:paddingTop="5dp"
114
+
115
+ android:paddingLeft="5dp"
116
+
117
+ android:id="@+id/text3"
118
+
119
+ android:layout_width="match_parent"
120
+
121
+ android:layout_height="wrap_content"
122
+
123
+ app:layout_constraintLeft_toLeftOf="parent"
124
+
125
+ app:layout_constraintRight_toRightOf="parent"
126
+
127
+ app:layout_constraintTop_toBottomOf="@+id/edit_text"
128
+
129
+ android:text="年齢"
130
+
131
+ />
132
+
133
+ <EditText
134
+
135
+ android:id="@+id/edit_text2"
136
+
137
+ android:layout_width="match_parent"
138
+
139
+ android:layout_height="40dp"
140
+
141
+ app:layout_constraintLeft_toLeftOf="parent"
142
+
143
+ app:layout_constraintRight_toRightOf="parent"
144
+
145
+ app:layout_constraintTop_toBottomOf="@+id/text3"
146
+
147
+ android:inputType="number"
148
+
149
+ android:background="@drawable/edittext_flame"
150
+
151
+ android:hint="20"
152
+
153
+ android:paddingLeft="5dp"
154
+
155
+ />
156
+
157
+ <TextView
158
+
159
+ android:paddingTop="5dp"
160
+
161
+ android:paddingLeft="5dp"
162
+
163
+ android:id="@+id/text4"
164
+
165
+ android:layout_width="match_parent"
166
+
167
+ android:layout_height="wrap_content"
168
+
169
+ app:layout_constraintLeft_toLeftOf="parent"
170
+
171
+ app:layout_constraintRight_toRightOf="parent"
172
+
173
+ app:layout_constraintTop_toBottomOf="@+id/edit_text2"
174
+
175
+ android:text="氏名"
176
+
177
+ />
178
+
179
+ <EditText
180
+
181
+ android:id="@+id/edit_text3"
182
+
183
+ android:layout_width="match_parent"
184
+
185
+ android:layout_height="40dp"
186
+
187
+ app:layout_constraintLeft_toLeftOf="parent"
188
+
189
+ app:layout_constraintRight_toRightOf="parent"
190
+
191
+ app:layout_constraintTop_toBottomOf="@+id/text4"
192
+
193
+ android:inputType="text"
194
+
195
+ android:background="@drawable/edittext_flame"
196
+
197
+ android:hint="山田太郎"
198
+
199
+ android:paddingLeft="5dp"
200
+
201
+ />
202
+
203
+
204
+
105
205
  何か解決方法があればぜひ教えていただきたいです。
106
206
 
107
207
  また、追加するプログラムはできる限りすべて載せていただければ幸いです。