How to Rub Image's Particular Portion?
<p>I have two images one in Background and another is in Front.I want to show Background image by rubbing the front image.I have done this but my problem is when the user touches some portion of the front image i want to show background image only in that position where the user touched on the image's portion.How to do that?I tried and found a lot here on SO as well as on GOOGLE.But yet Still not got the right solution.So please someone help me for my issue.Thanks in Advance.I have tried this:</p>

<pre><code>public class MainActivity extends Activity implements OnTouchListener {

private ImageView img;
// float counter = 0.1f;
float counter = 0.1f;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    img = (ImageView) findViewById(R.id.imageView2);
    img.setOnTouchListener(this);

}

public boolean onTouch(View v, MotionEvent event) {
    switch (event.getAction()) {
    case MotionEvent.ACTION_MOVE:
        Log.e("MOVE", "MOVE--" + counter);

        if (counter &lt;= 1.0) {
            Log.e("currentapiVersion", "currentapiVersion");
            counter = counter + 0.05f;

            img.setAlpha(counter);
        }
        // counter++;

        break;

    }
    return true;
}
</code></pre>

<p>}</p>
