Q:

how to add an image above swipe tab?

I am trying to add an Image above a Swipe Tab
Like in the Image below
!
I tried adding this:
    getActionBar().setIcon(R.drawable.ic_launcher);

and adding it in my viewpager xml above the viewpager but it didn't work
any idea how to do that?

A:

You might want to apply custom view to the action bar. Try something like this:
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);

LayoutInflater inflator = (LayoutInflater) this .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflator.inflate(R.layout.action_bar_layout, null);

actionBar.setCustomView(view);

And here is the action_bar_layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="fill_horizontal">

    <ImageView
        android:id="@+id/logo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/YOUR_IMAGE_GOES_HERE" />

</RelativeLayout>

