[Q] From activity to tabs - Java for Android App Development

Hi,
Is it possible from an ListView Activity according to which item is clicked to open new activity where will have 3 tabs which will load data from mysql?
What I mean is:
ListView (cars, trucks) . If I click cars should load from database models of cars and other info with tabs on new activity. If I click trucks will load info for trucks.
So far I have this listview. I also have the tabs. My problem is how to know which item is selected and what to load?

Related

[Q] Application Settings Menu

Hi guys
I'm quite new at android developing and i'm really just playing around making things for myself
Right now i'm making an app with a settings menu that the user can set a variety of options.
One thing i really don't understand and i'm guessing i'm missing something basic here that everyone knows is how to create these menus
The type of menus i'm talking about can be found if you open the Internet got Menu > More > Settings
The menu style that you get is a standard one that can be found in heaps of applications however i can't seem to be able to google myself to how you create these
Thanks
Scott.
There is a subclass of the activity class called PreferenceActivity. Use it mostly as you would a regular activity class, but you can add predefined preference panels to the view. See the sample here:
http://developer.android.com/resour...ple/android/apis/app/PreferencesFromCode.html

[Q] list selector menu

I have designed a new menu for my app, that i think is more appealing than the regular android "six pack" menu and as such uses none of the menu xml attributes and is purely designed in the java and layout file.
However one of the options requires a list, and instead of bringing up an entire new activity, i would still like to use the sub menu list type, is it possible to do this from a onClick case? if not can anyone suggest an alternative way to get a similar result?
all help is much appreciated thanks

[Q] Getting a button to funktion

Hi
im making this app where I want a list of stores divided into catagories such as: electronic, food, clothes. My problem is that I cant get figure out how to add a button, which should be clickable, and when the user clicked it, all the stores in that category would appear? I'm using Eclipse.
PS im a rookie a in developing apps
Hopes someone can help me.
Do you want to filter a single list in one activity depending on what button you click or just load a new activity with just that content in it?
Either way you will need a layout with a button in it and then you will get a reference to that button in your activity and then setOnClickListener() to it and define an action to take when pressed.
There are some good "Button Tutorials" on the android developer site as well as other places around the net
From something awesome
IMO, the quickest way is to toss the list in an array and load-up a ListView. Then setup a listener and use onItemClick().

ListView issues

Hey guys I need help.
I know how to create a listview but where I'm struck and confused is,
1.) Like when we click on 1st item of the listview another activity with another list view comes up and when we click on any of the item from that list view then a resource xml file with a table comes up.
2.) When I click on the second item of the LV an image is displayed.
3.) When I click on the 3rd item another list view comes up and then if click any of the item an image comes up.
I just tried to explain my problem. There are around 10-12 items in each list. So I am not getting what exactly to do.
I tried to make simple listview but now not getting how to modify it to match my needs...
Thanks
Just set an onItemClickedListener and watch, which item is clicked. Then start the different operations.
If the ListView does not change dynamically, it would be better to use a PreferenceActivity or a PreferenceFragment. It would be far easier to do what you wanted with this.

Search Database From A Web Server

I want my app to have a search function but instead of searching locally, I want to search from the data on my web server and return the data in a JSON format. The good thing is, I know how to do this but I'm not sure how can I implement an activity with this kind of interface and behavior.
Legends are as follow: (Please see the mockup image that I attached below)
Black - Action Bar
Blue - Activity Container
Red - Searching (Search input and button here)
Green - List View (Fetched data from the web server)
Basically I want the user to input their search key and when they press the search button, a loading image will appear while the data are being fetched, when the fetching is completed I want the fetched data to appear on the list view on the same activity.
Thank you and have a good day!
clonedaccnt said:
I want my app to have a search function but instead of searching locally, I want to search from the data on my web server and return the data in a JSON format. The good thing is, I know how to do this but I'm not sure how can I implement an activity with this kind of interface and behavior.
Legends are as follow: (Please see the mockup image that I attached below)
Black - Action Bar
Blue - Activity Container
Red - Searching (Search input and button here)
Green - List View (Fetched data from the web server)
Basically I want the user to input their search key and when they press the search button, a loading image will appear while the data are being fetched, when the fetching is completed I want the fetched data to appear on the list view on the same activity.
Thank you and have a good day!
Click to expand...
Click to collapse
Your red searching layout can either be done manually using a horizontal LinearLayout with an ImageButton and an EditText, or, in my view far easier, with a SearchView in the ActionBar. Head over to this documentation page to set it up! You'll then get a call to onNewIntent with the search query and use that to update your ListView from the server.

Categories

Resources