I have 2 classes:
public class TouchImageView extends ImageView
public class TouchImageViewActivity extends Activity
In my TouchImageView class I have touch listener that calculates where you have touched the image. What I need is to transfer the touch point to the TouchImageViewActivity without creating new instance of it. The touch calculated constancy.
Calling TouchImageView from TouchImageViewActivity:
TouchImageView img = (TouchImageView) findViewById(R.id.img);
img.setImageResource(R.drawable.g_map2048);
You can declare an
interfaceinsideTouchImageViewand makeTouchImageViewActivityimplements that interface..Then when you finish your calculations call
interface.method..this will call the method in the activity…Your interface:
TouchImageViewActivity :