Creat a listview when I click a button in android - android

Hello guys I am new on android programming.I want to create a shopping list app so the idea is first. This is my idea :
There is no list then when I click the Add Button
I can give a name to the list and after that add it ( where I can fill this list with products to buy later )
The problem I have is:
I can't find an idea how to create a list when I click a button like this image :
How can I create more than one list and show them like the picture below.
I don't need code, I just the idea and I will search for the rest myself. I already look everywhere but couldn't find solution for it. Thank you guys.

You don't really have to createp a list if you click the button. You have to create the list in the UI or the xml files. If you click the add button, what you want to happen is to add data for the list to display. If you don't know about ListViews and how to add data to them using adapters, I suggest reading more on the topic:http://www.vogella.com/tutorials/AndroidListView/article.html

Related

How can I create this layout in android like any.do application?

I want to create a layout like the one in the pictures below:
Category
Things to be done
The first picture displays the categories PERSONAL,OFFICE,WORKOUT.
On clicking one of them,the things to be done under that category is displayed.
Any suggestions/sample code for the same? Thanks.
Use Expandable Lists and extendable Adapter

Android Studio Dinamically add a new Section

I'm a beginner in Android development and I'm stucked in a way to dinamically add or remove a new Section.
The image below shows the way I want to do it. If I press the + button then a new item is created and I can insert the info about the item. If i press the - button then it will delete the item.
I don't want to make the items to be fixed. I need the user to insert as many items as they want to.
For dynamic views I suggest RecyclerView, which is more flexible than ListView and provide basic animations by default (proper calls on adapter - notifyItemInserted, notifyItemRemoved).
Here is an example.

Android Spinner like css tye

http://jinni.amtechgcc.in/upload/css type spinner.png
Hi
I am trying to integrate one spinner which is contain one sub item like i given url above.
Please give me solution it will be helpful me.
Thanks.
Easiest would be to create spinner with only main list.
Display sublist in dialog when user touches item. See http://developer.android.com/guide/topics/ui/dialogs.html - Adding List section
Or you can use ExpandableListView (ideally inside dialog) that contains list + sublists.

Android custom listview inside a window

i'm a complete beginner in android so i don't know how to explain it correctly,can anyone tell me how to create a custom listview inside another layout(i've seen tutorials showing how to make custom listviews out of xml files,in which they sets the contenview to the xml files and i couldn't find any tutorial to create a listview which already has other elements) ,what i'm trying to create is a windows with two listviews. When i click an item in the main listview the sub listview shows up which has a TextView, a rating bar and a button along with the itemname,
almost like this image
http://www.zdnet.com/i/story/60/01/054426/zdnet-box-playbook-listview.png
i believe you all understand what i'm trying to create
If what you want to do is a split view window with two diffrent Listviews that the one can pass data to another or update it in some way you need to take a look in List Fragments. There is a nice tutorial here : http://www.vogella.com/articles/AndroidFragments/article.html

Android ListView that opens a subset

I would like to design an item like this that opens a subset of other items when clicked, I have only seen it in other applications I've used, and I can't find any resources on how to create it. Does anyone know how to?
Thanks.
Its not clear if you want to created Nested listviews that look like this
-Item1
-Item2
---Item2A
---Item2B
-Item3
or if you want to open a completely new list when the user clicks on an item.
If you want to use a nested listview look at this question: android nested listview
And if you want to open a new activity, then create a 2nd activity with a listview and open that on an item click
Perhaps you should try to have a look at the ExpandableListView.
Documentation is available from here:
http://developer.android.com/reference/android/widget/ExpandableListView.html
If you wanted to add a ListView that opens another list, you can do it in several ways. I've successfully done it by adding an OnItemClickListener to the ListView and then simply load a new set of data in the ListView and update it using invalidate() or by setting a new Adapter.
You could even add some cool transitions or animations, and create a listener for when the animation is completed. Lots of cool ideas :-)

Categories

Resources