Java
package com.kc.optionmenu;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
menu.add(0,0,0,"Settings");
menu.add(0,0,0,"About");
menu.add(0,0,0,"Help");
menu.add(0,0,0,"Exit");
// TODO: Implement this method
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
if(item.getTitle()== "Settings"){
Toast.makeText(this,"Settings is clicked", Toast.LENGTH_SHORT
).show();
} else
if(item.getTitle()== "About"){
Toast.makeText(this,"About is clicked", Toast.LENGTH_SHORT
).show();
} else
if(item.getTitle()== "Help"){
Toast.makeText(this,"Help is clicked", Toast.LENGTH_SHORT
).show();
} else
if(item.getTitle()== "Exit"){
Toast.makeText(this,"Exit is clicked", Toast.LENGTH_SHORT
).show();
}
// TODO: Implement this method
return true;
}
}
Where ever you click on your page opens a new propaganda site!
ReplyDeleteAlmost impossible to use your page. Please disable those adds. You do not need this.