I have to build a dialog that looks exactly the same across different devices regardless of the OS theme. At the moment, I created an AlertDialog
and I call
For doing custom dialog look at the tutorial it is great http://developer.android.com/guide/topics/ui/dialogs.html about the borders see here http://developer.android.com/guide/topics/ui/dialogs.html you may also make use of this It have some great Ideas
create xml file. and use this java code.
info_dialog = new Dialog(ActivityName.this);
info_dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
info_dialog.setContentView(R.layout.info);
info_dialog.show();
You can specify Themes in views or activities. Have a look at this link
Go for this
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
public class FullyscutomDialo extends Dialog{
public FullyscutomDialo(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
@Override
public void dismiss() {
//do what you need before closing here
super.dismiss();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//set your custom layout here
//use layout attribut just like activity
}
}
then use two line to show it from activity(May be onclickevent etc)
FullyscutomDialo hh=new FullyscutomDialo (this);
hh.show()
Edited For Transparent Dialog
use In onCreate of dialog class
this.getWindow().setBackgroundDrawable(new ColorDrawable(0));
Cheers :):)