Android; Confused by views?
- by javano
I have created a class (InputControl) which extends the view of my main class (Main), and takes focus of the screen. I have a button on the main xml layout which calls control() and sets up my InputControl view, from there I capture user input. 
How can I return back to the xml layout from the InputControl view class?
public class Main extends Activity {
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    InputControl = new InputControl(this);
}
//......SNIP!
public void control(){
setContentView(InputControl);
    InputControl.requestFocus();
}
}
public class InputControl extends View implements OnTouchListener {
public InputControl(Context context) {
    super(context);
    setFocusable(true);
    setFocusableInTouchMode(true);
    this.setOnTouchListener(this);
}
public boolean onTouch(View view, MotionEvent event) {
//...I AM CAPTURING USER TOUCH EVENTS HERE
}
}