7

How to put two buttons on alert box

view full story
linux-howto

http://stackoverflow.com – I have made a program of simple alert box in android.now i have to put two buttons "OK" and "cancel" but when i run the program it only shows ,the "cancel" button...my code is as below: Main.java public class MainActivity extends Activity { Button btn; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btn = (Button)findViewById(R.id.button); final AlertDialog alertDialog = new AlertDialog.Builder(this).create(); btn.setOnClickListener(new OnClickListener() { @Overr (HowTos)