Dialog dialog = new Dialog(context); dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.your_icon); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Dialog Title"); dialog.show();
Dialog dialog = new Dialog(context); dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Dialog Title"); dialog.show(); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.your_icon);
Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); dialog.setContentView(R.layout.dialog); dialog.setTitle("My great title"); dialog.setCancelable(true); dialog.show(); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon); WebView vw = (WebView) dialog.findViewById(R.id.wv);
final Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); dialog.setTitle(R.string.my_dialog_title); dialog.setContentView(R.layout.my_dialog_layout); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,R.drawable.some_icon); dialog.show();
final Dialog yourDialog = new Dialog(YourClass.this); yourDialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); //must come BEFORE setContentView yourDialog.setContentView(R.layout.yourDialog_layout); yourDialog.setTitle("Your Title"); yourDialog.setCancelable(true); yourDialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.your_icon); //must come AFTER setContentView
Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON); // request the feature dialog.setContentView(R.layout.customlayout); dialog.setTitle("My Title"); dialog.show(); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_launcher); // set the icson
final Dialog dialog = new Dialog(this); **dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);** dialog.setTitle(R.string.my_dialog_title); dialog.setContentView(R.layout.my_dialog_layout); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,R.drawable.some_icon); dialog.show();
lp.height = WindowManager.LayoutParams.WRAP_CONTENT; dialog.show(); dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_launcher); dialog.getWindow().setAttributes(lp); dialog.getWindow().getAttributes().width = LayoutParams.FILL_PARENT;
dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_theme);