diff --git a/SocketFileTransfer/src/main/java/com/annimon/socketfiletransfer/CursorActivity.java b/SocketFileTransfer/src/main/java/com/annimon/socketfiletransfer/CursorActivity.java index 1542a0e..92693d9 100644 --- a/SocketFileTransfer/src/main/java/com/annimon/socketfiletransfer/CursorActivity.java +++ b/SocketFileTransfer/src/main/java/com/annimon/socketfiletransfer/CursorActivity.java @@ -4,6 +4,7 @@ import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; +import android.widget.Button; /** * @@ -22,10 +23,15 @@ public class CursorActivity extends Activity { getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); - TouchpadView view = new TouchpadView(this); - view.requestFocus(); - setContentView(view); + setContentView(R.layout.activity_cursor); - new SocketTransferTask(OperationListener.MODE_CURSOR_CONTROL).execute(view); + TouchpadView view = (TouchpadView) findViewById(R.id.touchpad); + view.requestFocus(); + + Button leftButton = (Button) findViewById(R.id.left_button); + Button middleButton = (Button) findViewById(R.id.middle_button); + Button rightButton = (Button) findViewById(R.id.right_button); + + new SocketTransferTask(OperationListener.MODE_CURSOR_CONTROL).execute(view, leftButton, middleButton, rightButton); } }