package com.example.androidtest; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; public class AlertTest extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final CharSequence[] items = {"First", "Second"}; AlertDialog alert =null; AlertDialog.Builder builder = new AlertDialog.Builder(AlertTest.this); builder.setTitle("Test"); builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { } }); alert = builder.create(); alert.show(); } }