对话框

阅读更多
1、自定义对话框
1.1、activity中
private void doOpenDownloadDialog() {
		LinearLayout cardUsers = (LinearLayout) this.getLayoutInflater().inflate(R.layout.downloadapp, null);
		final Dialog dialog = new Dialog(this);
			dialog.setContentView(cardUsers);
			dialog.setTitle("Title Name");
			dialog.show();
			
			RelativeLayout sendBtn = (RelativeLayout) dialog.findViewById(R.id.btn_add);
			RelativeLayout cancleBtn = (RelativeLayout) dialog.findViewById(R.id.btn_concel);
			sendBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				
			}
		});
			cancleBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				dialog.dismiss();	
			}
		});
	}
1.2、自定义一个XML页面,页面名称为:downloadapp.xml



    

        

你可能感兴趣的:(android)