Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Java by someone ( 14 years ago )
@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getSupportMenuInflater();
        inflater.inflate(R.menu.common, menu);
        return true;
    }

 @Override
 public boolean onMenuItemSelected(int featureId, MenuItem item) {
  switch(item.getItemId()) {
  case R.id.exit:
   TextView tv = new TextView(this);
   tv.setText("Some intro text");
   AlertDialog d = new AlertDialog.Builder(this).create();
   d.setContentView(tv);
   d.setTitle("Really?");
   d.setButton(Dialog.BUTTON_POSITIVE, "ok", new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
     finish();
    }
   });
   d.show();
   break;
  case R.id.logout:
   break;
  }
  return true;
 }

 

Revise this Paste

Your Name: Code Language: