chat-sdk-android icon indicating copy to clipboard operation
chat-sdk-android copied to clipboard

Custom Main ACTION BAR

Open matheuaviczki opened this issue 9 years ago • 1 comments

I need to identify where I can customize the main action bar of the layout. I need change the name and remvoe the icon.

matheuaviczki avatar May 02 '17 16:05 matheuaviczki

Hi @matheuaviczki,

After a bit of searching this answer seems to answer your question:

I have also copied the content below incase the link changes:

This is very simple to accomplish

If you want to change it in code, call:

setTitle("My new title");
getActionBar().setIcon(R.drawable.my_icon);

And set the values to whatever you please.

Or, in the Android manifest XML file:

<activity android:name=".MyActivity" 
       android:icon="@drawable/my_icon" 
       android:label="My new title" />  

To enable the back button in your app use:

 getActionBar().setHomeButtonEnabled(true);
 getActionBar().setDisplayHomeAsUpEnabled(true);

The code should all be placed in your onCreate so that the label/icon changing is transparent to the user, but in reality it can be called anywhere during the activity's lifecycle.

simonsmiley64 avatar May 02 '17 16:05 simonsmiley64