本文介绍了写在String.xml Android的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要写在文件string.xml从活动EDITTEXT一些值。我会用一个例子说明:

I want to write some values from editText of activity in the file string.xml.I will explain with an example:

在活动我有2 EDITTEXT和1个按钮提交信息。试想一下,在EDITTEXT是插入姓名。我有以下的code在string.xml

In the activity I have 2 editText and 1 button to submit the information. Imagine that the editText are for inserting NAME and SURNAME.I have the following code in string.xml

<string name="person_name"></string>
<string name="person_surname"></string>

在开始时,这些领域将是空的,但submiting的信息后,我想写从该文件中的editTexts获得的值。

At the begining, those fields will be empty but after submiting the info, I want to write the values obtained from the editTexts in that file.

任何建议?

在此先感谢

推荐答案

虽然你想要的东西是不可能的,但可以通过共享preferences来完成的 http://developer.android.com/guide/topics/data/data-storage.html#$p$pf

Although what you want is not possible but can be done through SharedPreferences http://developer.android.com/guide/topics/data/data-storage.html#pref

这篇关于写在String.xml Android的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!