how create main menu, and put the activity


Last Updated:

  1. dioni87

    dioni87 Member This Topic's Starter

    Joined:
    Oct 17, 2010
    Messages:
    11
    Likes Received:
    0
    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
     

    Advertisement
  2. Sam Voss

    Sam Voss Well-Known Member

    Joined:
    Jun 25, 2010
    Messages:
    367
    Likes Received:
    44
    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.
     
  3. dioni87

    dioni87 Member This Topic's Starter

    Joined:
    Oct 17, 2010
    Messages:
    11
    Likes Received:
    0
    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?
     
  4. Sam Voss

    Sam Voss Well-Known Member

    Joined:
    Jun 25, 2010
    Messages:
    367
    Likes Received:
    44
    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
     
  5. dioni87

    dioni87 Member This Topic's Starter

    Joined:
    Oct 17, 2010
    Messages:
    11
    Likes Received:
    0
    yes, thats im looking for sam voss...
     
  6. Sam Voss

    Sam Voss Well-Known Member

    Joined:
    Jun 25, 2010
    Messages:
    367
    Likes Received:
    44
    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 (Text):
    1. private OnClickListener matrix = new OnClickListener()
    2. {
    3.     public void onClick(View v)
    4.     {
    5.         finish();
    6.         Intent myIntent = new Intent(mainScreen.this, matrix.class);
    7.         mainScreen.this.startActivity(myIntent);
    8.     }                              
    9. };
    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!
     
  7. Sam Voss

    Sam Voss Well-Known Member

    Joined:
    Jun 25, 2010
    Messages:
    367
    Likes Received:
    44
    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
     
  8. dioni87

    dioni87 Member This Topic's Starter

    Joined:
    Oct 17, 2010
    Messages:
    11
    Likes Received:
    0
    No problem Sam Voss, thank you for helping me...now i'll try again using your example
     
  9. Sam Voss

    Sam Voss Well-Known Member

    Joined:
    Jun 25, 2010
    Messages:
    367
    Likes Received:
    44
    so you want an example? or using what i said?
     
  10. dioni87

    dioni87 Member This Topic's Starter

    Joined:
    Oct 17, 2010
    Messages:
    11
    Likes Received:
    0
    i've try but still error...so i want an example sam voss...
     
  11. Sam Voss

    Sam Voss Well-Known Member

    Joined:
    Jun 25, 2010
    Messages:
    367
    Likes Received:
    44
    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.
     
  12. dioni87

    dioni87 Member This Topic's Starter

    Joined:
    Oct 17, 2010
    Messages:
    11
    Likes Received:
    0
    Ok no problem Sam, i will wait...thak you sam
     
  13. Sam Voss

    Sam Voss Well-Known Member

    Joined:
    Jun 25, 2010
    Messages:
    367
    Likes Received:
    44
    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!
     

Share This Page

Loading...