0
我有一个问题的数组,它显示在屏幕上。当你点击一个物品时,你会转向一个物品。这一切工作正常。但(标题)标签不显示问题,只显示应用程序名称。android更改labelname与数组的项目
我试过this文章。但是每次你点击一个问题,这是一个不同的问题,所以你不能硬编码。温你点击一个新的活动开始的问题。如果问题(数组的项目)发送到新的活动,我会很好。
因此,这是一个充满的阵列问题的项目列表视图:
当你点击一个问题,这是新的活动:
的“IDP2013”必须改变总结您点击的问题。
list_data.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="Questions">
<item>Where is the exit button?</item>
<item>Why cant I launch a rocket?</item>
<item>Why cant I hack the other teams?</item>
<item>How can I get back to the home screen?</item>
<item>test</item>
</string-array>
<string-array name="Answers">
<item>Right above, click the button and then the last button "exit".</item>
<item>Because there is no rocket.</item>
<item>Have patience.</item>
<item>Left above, click the button. </item>
<item>test</item>
</string-array>
的AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.activity.idp2013"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
...
<activity android:name="com.activity.idp2013.SingleListItem"
android:label="@array/Questions">
</activity>
...
</application>
</manifest>
第一个代码块中的configIntent是不是意图? – Lutske 2013-05-06 10:12:26
是的,我的坏,更新帖子 – bakriOnFire 2013-05-06 10:14:11
它说它找不到匹配。所以我必须添加questionName到strings.xml。但是它再次无用,因为它不再是可变的。 – Lutske 2013-05-06 10:29:38