public class CustomDialog extends Dialog {

public CustomDialog(Context context) {

super(context);

// TODO Auto-generated constructor stub
}

protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);

setContentView(R.layout.custom_dialog);
LayoutParams params = getWindow().getAttributes();
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);


setTitle("Custom Dialog");
TextView text = (TextView)findViewById(R.id.text);
text.setText("Hello, this is a custom dialog!");
ImageView image = (ImageView)findViewById(R.id.image);
image.setImageResource(R.drawable.sepurple);

Button buttonYes = (Button) findViewById(R.id.button_yes);
buttonYes.setHeight(5);
buttonYes.setOnClickListener(new Button.OnClickListener(){

public void onClick(View v) {
// TODO Auto-generated method stub
dismiss();

}
});
Button buttonNo = (Button) findViewById(R.id.button_no);
buttonNo.setSingleLine(true);
buttonNo.setOnClickListener(new Button.OnClickListener(){

public void onClick(View v) {
// TODO Auto-generated method stub
dismiss();

}
});
}

//called when this dialog is dismissed
protected void onStop() {
Log.d("TAG","+++++++++++++++++++++++++++");
}


}

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android 6.0替换原系统Launcher傻瓜教程
  2. Android中的快捷键
  3. Android跨进程唤醒APP,启动指定页面
  4. AndroidStudio开发遇见问题总结
  5. Android动画之Animation
  6. Android MVVM
  7. Android(安卓)ScrollView与 X5Webview+Re
  8. android 设置文本透明度
  9. Android 动画之Tween动画详细讲解
  10. android每日一问【2011-8-25】