I have an array with questions, which is display on the screen. When you click on a item, you go to the anwer. That's all working fine. But the (header)label doesn't display the question, only the app name.
I readed this article. But every time you click on a question, it's a different question, so you can't do it hardcoded. Wen you click on a question a new activity starts. I would be nice if the question(item of the array) is send to the new acitivity.
So this is the listview filled with the items of the array questions:
And this is the new activity when you click on a question:
The "IDP2013" has to change tot the question you clicked on.
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>