I have created an AlertDialog with OK button. But it is only displaying the button partially.
I use following code
private void showErrorDialog(String msg) {
final int
//Log.i(tag, "showAlert with message: " + msg);
final AlertDialog.Builder errDialog = new AlertDialog.Builder(context);
errDialog.setCancelable(false).setPositiveButton("Ok", listener);
TextView txtView = new TextView(context);
txtView.setSingleLine(false);
txtView.setText(msg);
errDialog.setView(txtView);
//Log.i(tag, "dialog created");
context.runOnUiThread(new Runnable() {
@Override
public void run() {
//Log.i(tag, "showing dialog ..............");
MyUIClass.errorDialog = errDialog.create();
context.showDialog(MyUIClass.ERROR_DIALOG_ID/* , null */);
}
});
//Log.i(tag, "show()");
}
What could be the issue?
thanks
You should have to Use Dialog in Case when you want Customize View to Show TextView and Button Below It.
Check Reference Link for Creating Dialog you want . http://www.helloandroid.com/tutorials/how-display-custom-dialog-your-android-application