0

i am designing an application which have diff types of functionalies through buttons/image buttons. At final the list might increase. i want to put one custom home button which always keeps on screen when i am in diff activities. or either if you have any idea about how this Home button is coded to this layout below screen. please help.

enter image description here

Kara
  • 6,115
  • 16
  • 50
  • 57
Deepu Mandy
  • 117
  • 12

4 Answers4

1

While the home button at the bottom can be easily achieved using an image view/button,Using an action Bar is the recommended option.Not only can you link with the home activity but also any other activity of your choice.Refer this to gain a deeper insight.

http://developer.android.com/guide/topics/ui/actionbar.html

http://developer.android.com/reference/android/app/ActionBar.html

Mukund Samant
  • 1,079
  • 7
  • 12
1

Have you considered the Action Bar which is exactly designed for this purpose? http://developer.android.com/guide/topics/ui/actionbar.html

Vikram Bodicherla
  • 7,133
  • 4
  • 28
  • 34
  • now i getting home to one Activities, how can i get for entire project for diff Activities also. is any possibility? – Deepu Mandy May 24 '12 at 05:36
  • You'll have to add the ActionBar to all Activities. To make it easier, create a BaseActivity class which extends Activity which encapsulates this functionality, and then let all your classes extend this. – Vikram Bodicherla May 24 '12 at 06:49
0

You can either place a button/image button/image anything in xml layout and set on click listener on that component. You can also use option menu and give multiple option on all the screens of your application.

Krishnakant Dalal
  • 3,568
  • 7
  • 34
  • 62
  • 1:image button:if i used in AbsoluteLayout for xml it fixed at bottom(i put home at bottom middle), in future i have to add more buttons, so makes problem. – Deepu Mandy May 23 '12 at 09:41
0

Make a layout with a ScrollView on top, and your image-button below the scrollview.
Example:

<!-- language: lang-xml -->
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
  <ScrollView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Your Content Here"
    />
  </ScrollView>
  <LinearLayout
  android:layout_width="fill_parent"
  android:layout_height="wrap_content">
    <ImageView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_launcher"
    />
  </LinearLayout>
</LinearLayout>

It looks like this:
Screenshot

FrankkieNL
  • 711
  • 9
  • 22