Search code examples
androidandroid-homebutton

How to create custom home button which shows for all activities of my project?


enter image description here

How to create picture type of home button which shows for all activities of my project. i have 4 or 5 activities is there.

I want to click that button go back to main window. please give me code

first how to create a home button


Solution

  • An Action Bar and a dashboard might be better suited to what your trying to do, or just use an options menu. Have a look at 'Google I/O 2010 - Android UI design patterns' on youtube. That will help you ask clearer questions. Motodev Studio will help getting started with what you learn in the video (but I personally don't like the code generated).

    If after watching the video above you still want the home button like your screenshot you could probably use a relative layout with a layout include or fragment aligned to the bottom, with the include or fragment containing a image button.

    Actually both methods above require similar code, but action bars are cool.