简体   繁体   中英

Android same layout different data

I'm creating a local android application and am trying the following:

The main menu consists of 4 buttons, each will lead to a (different) list of chapters.
The layout of the chapters view is the same, so I am trying to use one layout for every chapters page, by using different strings depending on the button that's being pressed at the main menu. So when the user presses button 1, the list of chapters differs from when the user presses button 2, etc.

I have tried looking up solutions, but was unable to find any so far. Is there a way to call a certain set of strings depending on the button that is chosen?

Have you tried to use a custom list adapter which take your array of strings as a parameter? Your list of chapter is just a simple listview with one string in each row right?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM