In the main page of my android app I've added OptionsMenu.
What i want is when the option "ContactUs" is selected a new Activity called "ContactUs" should get called.
public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
if (item.getTitle().toString().equals("ContactUs")) {
ContactUs contact = new ContactUs(Home.this);
}
return true;
}
And when the ContactUs activity is opened its layout should be displayed:
public class ContactUs extends Activity{
private Context CONTEXT;
public CustomEqualizer(Context c){
this.CONTEXT = c;
setContentView(R.layout.contactus);
}
}
But the problem is the layout will not be displayed until onCreate method is called.
My question is how can I call ContactUs option from Home without startActivity?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…