On Fri, Jan 22, 2016 at 8:00 PM, Matt Fach <matt.f...@gmail.com> wrote:

> Hey thank you again for replying!  I really appreciate it.
> Lemme add the pictures.  Can you maybe explain this in more detail?
> "Again, if you need to represent a hierarchical structure (think file
> system) then you could very simply have a single activity that has a list
> of items, where clicking any item starts a new instance of the same
> activity with the list containing the children of the previously selected
> node. "
>

If you have a class MyListActivity, then when you open the app you start
like this:

MyListActivity (instance 1)
+-> ListView
+--> Item 1
+--> Item 2
+--> .....

Now if you click on Item 1  you get a second instance of MyListActivity,
with the list containing the children nodes of Item 1

MyListActivity (instance 2)
+-> ListView
+--> Item 1 Subitem 1
+--> Item 2 Subitem 2
+--> .....

Now if you click on Item 1 subitem 2, you get a third instance of
MyListActivity, with the list containing the children node of Item 1
Subitem 2.

And so on so forth.

Back to the file system example, this is akin to viewing your desktop and
list of all files and folders on your desktop, then clicking a folder and
viewing the files and folders that are contained there. Same view, same
interactions, just different data being operated on. Make sense?

Now then, this assumes that all of the data is of the same type (in this
case "Folder"). If the thing you click on describes something different
(say ".java file") then you will of course have to navigate to a different
screen that has a different display. So, using your own images as an
example, if you started on the first screen (MyListActivity) and selected
the first item, that would lead to MyDetailActivity for the selected item
(Aniracetam).

Basically what I want is for the user to be able to navigate though all the
> categories and discover different drugs.  for instance the users will get
> a list view of a bunch of different drug categories arranged by
> pharmacology.  Then the user can enter into one of those drug types.  Then
> in the next screen will be another list of that specific drug type broken
> down into more categories.  So multilevel listviews.  I don't really like
> the "expandable" listviews where it all shows on one screen.  It kinda
> looks sloppy
>

Good, I agree that would be sloppy, but that's what you described in your
first post. "ListView within Listviews" or "multilevel ListViews" sounds
like you want them embedded in each other in the same screen. What you're
looking for, what I'm describing, and what you are now describing, having
the user navigate to a next screen on selecting something, is "drilling
down".


> So, I am sure there is a much better way of approaching this.  Again, I
> was a little confused to your response I put in quotes.  Could you maybe go
> into a little more detail of what I should do to obtain this?  Or a better
> idea, ect..
>
> Do you understand basically what I am trying to do with my app?
>

This really sounds like a fairly straightforward drill-down list,
potentially ending in a detail screen (for the leaf node). There should be
more than enough info on the interwebs to get you going, assuming you get
your terms right. A few things to research:

   - ListView - displaying a simple list, selecting an item in the list,
   starting a new activity and passing it parameters
   - RecyclerView - same concepts
   - "master detail" flow
   - "drill down" flow

If you're still stuck, then provide specifics of what exactly you're stuck
on and we can help further.

On Fri, Jan 22, 2016 at 9:27 PM, Mark Phillips <m...@phillipsmarketing.biz>
 wrote:

> As the user drills down into your data (ie selects an element from the
> list), all you need to change is the data displayed in the same listview.


Note that if you use this strategy, pressing back would immediately exit
the app, instead of "going back" as the expected default behavior. The
typical pattern is to launch a new activity on the stack (or a fragment if
that floats your boat) with the new data and let the system handle the back
navigation for you.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CANCScghG0b6Y2asLeCV8nB_gH%2B2YDc75it7fEHeu_-RjSUOdCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to