android phonegap
android phonegap

Reputation: 830

how to add icons beside app_name in android

I need a help regarding an issue in android...

I have an application with a name "Example" which i declared it in string<string name="app_name">Example</string>and now i want to add some buttons/icons like search beside my app_name...

on emulator it should look in this format: app_name-------------------------icon1--icon2--icon3

hope my question is clear at least up to some extent

can anyone help me how to achieve this i'm new to android clear explanation will be more helpful please help me................

Thank you in advance

Upvotes: 1

Views: 3292

Answers (3)

Rani Kheir
Rani Kheir

Reputation: 1079

I think what you're looking for is making menu items showAsAction and have an icon.

Here's an example of how a menu item would look like in the menu's xml:

<item
        android:id="@+id/action_about"
        android:orderInCategory="100"
        android:title="@string/action_about"
        android:icon="@android:drawable/ic_dialog_info"
        app:showAsAction="always" />

app:showAsAction will make it show beside the title (outside of the menu).

android:icon will give it an icon.

Here's a screenshot:

Menu icon by App name

If you put too many and force them to show with always, it would show like this:

Menu icons by App name

Upvotes: 1

Zillan
Zillan

Reputation: 720

Just set these icons in the drawable folder. I prefer it in the medium quality. Then just add these images in your main.xml

<ImageButton 
android:id="@+id/ImageButton01" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:src="@drawable/album_icon" 
android:background="@drawable/round_button" />

Upvotes: 0

user1153176
user1153176

Reputation: 1026

you want to add icon with application name in phone gallery?

you modify your manifest file

<application
    android:icon="@drawable/here is your image name"
    android:label="@string/app_name" >
</application>

you simply chage application icon

Upvotes: 0

Related Questions