Okay, so this far I made my app display an activity and can link to different activities based on click cases. Now, my question would be, how do you populate the opened activity with data that corresponds with the data in the item of the listview?
Easy said,
ListView (for ex. 10 items)
On click, opens ContentViewer activity
void ContentViewer::onCreate() {
setContentView contentviewer(xml);
}
(contentviewer has different textviews and imageviews with diff IDs.)
Now, when contentviewer is opened by clicking case 0 (first item in listview), then data 0, image 0 and so on.
Any ideas?
Essentially you’re looking at way to pass params to your second activity from the first? Here’s how:
The idea here to to put name/value pairs into your
Intentfrom the calling activity and in the called activity you read the name/value pairs off of the invoking intent. In the example above I am passingint(reportID)to the calling activity. You can pass any other primitive type to it. If you’re looking to pass custom objects, you’ll need to implementParcelable.