【发布时间】:2015-01-05 08:54:52
【问题描述】:
所以我尝试在 GUI 中显示我从父活动继承的字符串变量。
这是我的 xml 代码
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:inputType="text"
android:textStyle="italic"
android:id="@+id/Edit_Title_Update"
android:text="@string/updating_title"/>
这是我的字符串定义
<string name="updating_title"> %s </string>
这就是我尝试将日期放入字符串的方式
String updating_title = getString(R.string.updating_title, show_title);
Log.e("MyTag","Here2 "+updating_title);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_update__diary);
在控制台中我可以看到变量是正确的
01-05 10:19:29.767 2849-2849/com.example.wenhaowu.diaryproject E/MyTag﹕ Here2 Happy
但在模拟器中字符串保持不变
有什么问题,我该如何解决?谢谢。
【问题讨论】:
标签: java android xml user-interface