开发者

Best way to to create a complex search form in Android

I'm trying to create and Android application which requires a number of search criteria which will eventually form an SQL query and run against a database.

The first set of criteria I'd like to present as a 3-tier list where the choices are dependent on the prior choice but there is only one final choice. So you could 开发者_JS百科navigate to commadore via Car > Holden > Commadore. But you may only want to navigate to Car (and see a list of all cars) or Holden and see a list of all holdens.

  • Car

    • Holden
      • Commadore
      • Berina
    • Renault
      • Megan
  • van
    • van 1
      • Van 1 type 1
      • Van 1 type 2

etc etc

There will also be other criteria such as colour, place and a free text search, I'd like to present these on a different tab or separate them somehow. I've looked at a tabbed layout but it appears that each tab uses a different activity and I believe that it is complicated for separate activities to talk to each other.

I'd appreciate any thoughts on this as I don't have time to discover all the shortfalls with this that others may have already experienced. Thanks for your help.

Much appreciated. M


You can create Views instead of activities for the content of each Tab. The Activity which contains your TabHost will then be able to use the values selected from each of the views.

As for the lists, and sublists you can start to look in to the ExpandableListView, however that only provides a two level list, so you would need to look at extending it to allow n-levels I guess.

Alternatively you can have n-number of ListViews and transition between them IF the user makes a selection.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜