Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将如何编写我的 android 应用程序以记住用户在两次使用之间输入的值?
例如,假设我有一个EditText“ input1”和一个spinner“ input2”,它们给出了一个textview名为“ output1”的结果。
EditText
input1
spinner
input2
textview
output1
目前,当我关闭并重新打开应用程序时,所有输入的值和计算都会丢失并重置。
我怎样才能解决这个问题?
你有三个选择。在这里查看所有内容。
在您的情况下,文件 I/O 和数据库将是多余的。我推荐使用 Preferences API。
您可以使用 SQLite 或原始文件系统。记事本教程展示了 SQLite 的基本用法。