现在的位置: 首页 > 综合 > 正文

AlertDialog single choice

2013年08月08日 ⁄ 综合 ⁄ 共 601字 ⁄ 字号 评论关闭

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();
	}
	

}

抱歉!评论已关闭.