I am trying to pass "message" string to MainActivity using intent, I tried everything but still no luck. Can you help me through this.
public class MoveMouse {
public boolean onTouchEvent(MotionEvent event) {
int eventaction = event.getAction();
switch(eventaction) {
case MotionEvent.ACTION_MOVE: {
// new position
final float x = event.getX();
final float y = event.getY();
// get delta
final float deltax = x - this.lastX;
final float deltay = y - this.lastY;
// set last position
this.lastX = x;
this.lastY = y;
String message = (deltax + "," + deltay);
//intent
Intent ins = new Intent(this,MainActivity.class);
ins.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ins.putExtra("mv", message);
this.startActivity(ins);