The scenario;
Main.java
[main calls otherclass with an intent]
Otherclass.java
[otherclass implements a Control and sets it as its view so I can capture input]
Control.java
How can I from Control (which is extended the view of otherclass) kill the otherclass intent and return back to mainclass. I have been capturing input so say a double tap on the control can trigger this event but I can't seems to get it right?
Under otherclass I had;
Which I called from Control with;
But that doesn't do anything? (no errors, nothing?)
I also changed the Back() method to the following;
But that crashes my app?
I am clearly lost, what have I miss-understood here?
Main.java
[main calls otherclass with an intent]
Code:
Intent intent = new Intent(TestActivity.this, Otherclass.class);
startActivityForResult(intent, INT_INTENT);
Otherclass.java
[otherclass implements a Control and sets it as its view so I can capture input]
Code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Control = new Control(this);
setContentView(Control);
Control.requestFocus();
Control.java
Code:
public class Control extends View implements OnTouchListener {
.....//code goes here
}
How can I from Control (which is extended the view of otherclass) kill the otherclass intent and return back to mainclass. I have been capturing input so say a double tap on the control can trigger this event but I can't seems to get it right?
Under otherclass I had;
Code:
public void Back(){
Intent returnIntent = new Intent();
returnIntent.putExtra("value", "one");
setResult(RESULT_OK, returnIntent);
finish();
}
Which I called from Control with;
Code:
new Otherclass().Back();
I also changed the Back() method to the following;
Code:
public void Back(){
setContentView(R.layout.main);
}
But that crashes my app?
I am clearly lost, what have I miss-understood here?