Android Question Navigating multiple listviews / scrollviews

kcrcawol

Member
Licensed User
Longtime User
I want to make an app that presents a user with an initial listview that, depending on which item is selected then the appropriate next listview is shown. The 2nd (sub?) listview will contain more items that either lead to another listview (etc etc) or to a display of text about the item selected. Ideally each subsequent listview (or final text blurb) will have a “back” button

I have done something similar to this in as IOS app with a Navigation controller /Table View Controller / UIWebView (for text blurb) . The items / sub-items/textfiles were stored in a plist dictionary, Ideally I want to achieve something that looks similar (though I suspect it will need to be done programmatically).

Not looking for a free ride here . I just need help figuring out what model (and views) to use as I have only ever used b4a for apps that retrieve sqlite data with some basic filters.

Any advice much appreciated.
 

eps

Expert
Licensed User
Longtime User
This sounds quite simple to do in B4A, I've got something similar in the motorsport calendar app.

It all depends on what you want to display. Then just consume the click event and then show and hide the relevant list view. I would suspect that you will need to use addtwolines2 so that a tag or identifier is stored and used to display the next list view list etc...

When you want to go back... You will need to keep track of the ListView currently displayed and then consume the back button, work out where it is and then process the back button appropriately. There will be a Keypress event to consume this.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Sor simple layout (listview, a text to show or an image) i think now i would do this in one activity using visible false/true of listview and other objects. Or a tabhost. I think that should be the best to start with for a beginner in b4a. I mean the variant with TABHOST.
You can have a look at this library. Here you can have a menu and tabs.
 
Upvote 0

kcrcawol

Member
Licensed User
Longtime User
Sor simple layout (listview, a text to show or an image) i think now i would do this in one activity using visible false/true of listview and other objects. Or a tabhost. I think that should be the best to start with for a beginner in b4a. I mean the variant with TABHOST.
You can have a look at this library. Here you can have a menu and tabs.


Thanks for both replies , I used eps's stored "tag" approach. I did find some posts on parsing plists but for a small dictionary it was easier to keep track of next/previous in the code . Thanks again
 
  • Like
Reactions: eps
Upvote 0
Top