I am developing a sample app.I am able to show alert on button click having some tittle and button .But now I want to show a pop up window having username (Label)
you can use Dialog , like this code :
final Dialog dialog = new Dialog(context);
// dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.custom);
dialog.setTitle("Title...");
// set the custom dialog components - text, image and button
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Android custom dialog example!");
Button dialogButton = (Button) dialog.findViewById(R.id.dialogButtonOK);
// if button is clicked, close the custom dialog
dialogButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
if you want to remove title bar just use this code after define :
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);