I want to setOnClickListener to my ImageView which is in a ViewPagerItemXML.
In my activityXML I have ViewPager and several other buttons. In my ViewPagerItemXML I have clickable ImageView. I want to make some action after clicking to ImageView in activity. Unfortunately OnClickListener does not trigger at all.
LayoutInflater inflater = (LayoutInflater) this
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
itemView = inflater.inflate(R.layout.viewPager_item, null);
onThemePhotoClick= (ImageView)itemView.findViewById(R.id.themePhoto);
onThemePhotoClick.setOnClickListener(new View.OnClickListener() {
     @Override
     public void onClick(View v) {
          Log.i(TAG,"clickOnPhoto!");
     });
EDIT
My Activity XML
LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
     android:orientation="vertical"
        android:weightSum="10">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical"
        android:id="@+id/iconTools">
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_navigate_before_black_36dp"
            android:background="@android:color/transparent"
            android:id="@+id/backButton"
            />
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:orientation="horizontal"
        android:layout_height="0dp"
        android:layout_weight="8"
         android:id="@+id/viewPagerLayout">
        <android.support.v4.view.ViewPager
        android:id="@+id/visitMuseumPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:listitem="@layout/art_work_item" />
</LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical"
        android:id="@+id/bottomButtonToolbar">
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/qrScannerButton"
        android:text="QrCode" />
</LinearLayout>
    </LinearLayout>
And the viewPagerItem
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:fillViewport="true">
<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="10dp">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="200dp">
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/WelcomeScreenDarker"
            android:id="@+id/imageBackground"
            />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:id="@+id/themePhoto"
                android:clickable="true"
                />
        </RelativeLayout>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/artWorkCounter"
        android:textColor="@color/searchHint"
        android:textSize="12sp"
        android:layout_marginRight="80dp"
        android:layout_gravity="end" />
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/artWorkDescriptionTitle"
           android:paddingTop="15dp"
            android:textSize="20sp"
            android:textStyle="bold"
            android:layout_margin="10dp"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/artWorkDescription"
            android:layout_margin="10dp"
           />
    </LinearLayout>
</ScrollView>
    </LinearLayout>
EDIT 2 I solve my problem by adding OnClickListener into the viewpagerAdapterClass. It probably trigger on another view. If somebody know how to trigger button for the actual activity class please give me a hint
 
     
     
     
    