• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps how create main menu, and put the activity

dioni87

Newbie
does anyone know how to make the main menu?
please help me ...
I've tried adding the folder menu and menu.xml but still error ...
and how to insert the activities...

Thanks
 
This is pretty easy actually, I do it in my application, because at the beginning, you need to choose what solver you're looking for. I'm not sure what you're exactly trying to do, but check out Ultimath Beta in the app market, or look at the Ultimath post here, and if the main menu looks like what you're going for, I can help you further.
 
thanks Sam Voss...
im trying to make an LBS app, and i want for the first time app launch it show menu that contain my potition, nearest me, navigate...and i interested in your ultimat menu, can you tell me how to make that?
 
Alright, so I'm in school and on my phone, so for now here's a quick overview of what this includes, and if its what your looking for.

So, first off, you start in what ill call a "main menu" method, which will be the first screen that opens on application launch. This will have your buttons that point to other activites, saying what the main menu is doing is directing you to another activity.

The main. Menu has buttons that will use intents to start another activity in the onClick, is this what your looking for? If so, ill continue but until then, just let me know
 
you can go with just sam, anyway, sorry I work/school a ton, its pretty simple actually:

So what you do is pretty much have an activity called "mainScreen" or whatever you'd like, which has the buttons corresponding to each activity, and in each onClick, you add an intent that starts the next activity, corresponding with the button thats been clicked, for example:

you have 3 activities, location, distance, nearest

you have 3 buttons, pretty much the same thing, so when the button for location is pressed, you would start the location activity, which should be completely separate, so if you want, you can even call finish() before you call the intent so you dont end up with needless tasks running. I suggest putting a "main menu" or "back" button in each activity so that you can return, if you dont, just make sure that you dont use the finish() command or you will be backing out of the program: heres an example onClick that I'm speaking about:

Code:
private OnClickListener matrix = new OnClickListener() 
{
    public void onClick(View v) 
    {
    	finish();
    	Intent myIntent = new Intent(mainScreen.this, matrix.class);
    	mainScreen.this.startActivity(myIntent);
    }		    			    	
};

thats obviously after declaring the button, and the onClick listener. Let me know if you need more help, just let me know where you need it. if this helped, dont forget to thank!
 
Also, if need be, I'll make you an Example program with like a main menu and 4 buttons pointing to 4 different activities. Have a good one, sorry for late response time
 
Alright dude no problem, I'll fix up a quick example and get it all ziped up and ready for you soon enough. Sorry about not being able to have a time.. may be a few days, I've got a lot I need to be doing.
 
yep no problem, Its going to be started prob right after i finish V 1.3.5 update.. that might be a few days yet though.. have a good few days!
 
Back
Top Bottom