ClipDrawable how to change the image
<p>Im trying to implement a ClipDrawable appear by clicking with diferents images</p>

<p>I have this working with a simple image</p>

<p>Code:</p>

<p>MainActivity.java</p>

<pre><code>    ImageView imageview = (ImageView) findViewById(R.id.image);
    drawable = (ClipDrawable) imageview.getDrawable();
    drawable.setLevel(0);
    imageview.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            drawable.setLevel(drawable.getLevel()+1000);
        }
    });
</code></pre>

<p>activity_main.xml</p>

<pre><code>&lt;ImageView
    android:id="@+id/image"
    android:src="@drawable/clip_source"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
 /&gt;
</code></pre>

<p>clip_source.xml</p>

<pre><code>&lt;clip xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/tree"
    android:clipOrientation="vertical"
    android:gravity="bottom"
 /&gt;
</code></pre>

<p>this is working but for my project I need to change the image displayed with a variable to display diferents images depending of the user input</p>