I want to show an activity in an Android application I'm writing with Eclipse. This is the way I do that:
Intent intent = new Intent(HomeActivity.this, SecondActivity.class);
intent.putExtra("query", query);
startActivity(intent);
How can I handle the events of the new activity just where I'm showing it? I have made an event listener for the second activity. If I want to handle the events I should make an instance of the class "SecondActivity" like this:
SecondActivity act = new SecondActivity();
act.itemselectedlisteners.add(new ListItemSelectedListener() {
@Override
public void onItemSelected(String key) {
// TODO Auto-generated method stub
}
});
But then I don't know how to show the dialog. How do I combine these codes?