I am a new to android development and need help. Please explain in detail and not just supply me with an answer that would be ideal.
My issue: I created a dialog box for my app and well it displays great, it dims the app and just opens the box but I am having issues closing it. If someone wanted to exit out of it, they would have to press the back arrow button. Yeah, this is not hard-work, but I would like my app to be nicely done and clean-cut. So I was wondering if there was a way to put an "X" at the top right corner to exit the dialog box?
If someone could add on to my code that would be perfect.Like I said, I am new to this and someone telling me just add this. I would not know where to add that code to.
My Code:
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}
public boolean onCreateOptionsMenu(Menu menu){
super.onCreateOptionsMenu(menu);
MenuInflater library = getMenuInflater();
library.inflate(R.menu.main_menu, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()){
case R.id.menuAus:
startActivity(new Intent("com.tester.web.AUS"));
return true;
}
return false;
}