You can use custom action bar
actionbar.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/profile_icon" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="APP_Name" />
</LinearLayout>
Add following lines in Activity.java
Objects.requireNonNull(getSupportActionBar()).setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setCustomView(R.layout.actionbar);
OR
You can use following code to set icon on action bar
setTitle("title");
getActionBar().setIcon(R.drawable.profile_icon);
OR
If you have constant logo then add following code in manifest
file
For single activity
<activity android:name=".MyActivity"
android:icon="@drawable/profile_icon"
android:label="title" />
For all activities
<application
android:logo="@drawable/profile_icon">
...
</application>