开发者

How to go from a selected button in a list to different activities or the same activity with different text [duplicate]

This question already has answers here: ListView with a dynamic intents that change a TextView and WebView on each call (2 answers) Closed 8 years ago.

So, I'm making my first android app and want to perform a simple task, but can't seem to figure out the way to do it. I simply want to go from a list view to a screen of differing information based on which button was pressed. The information is similar enough(ie. a title and block of text) that I think I can use the same activity for it all, but I don't know how to switch out the different information based on the user's selection. Should I make a separate activity for each bu开发者_如何学JAVAtton in the list, or can I have the first activity send context to a single next activity and somehow determine what xml code to use, and how do I do it?


You can refer to my answer here. The original question in that thread also now contains an example of some code that appears to work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜