I have multiple editText in my app. I have achieved to show value of editText in alert dalog. The problem is that its shown in center of screen and sometimes cover the editText. I want a way that the alert dialog {with no title and no button (which I have already done) and show just message} to shown below the specific editText which I click.
Any help would be appreciated. Thanks in Advance
NOTE CHANGING GRAVITY DOESNT HELP BCOZ OF DIFFERENT SCREEN SIZES
MY CODE
UNDER ON CREATE
etDesc = (EditText) findViewById(R.id.etdesc);
etDesc.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
if (etDesc.getText().toString().equals(("")))
{
//Do nothing
}
else
{
setalert();
}
}
});
FUNCTION OF ALERT
public void setalert()
{
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
AlertDialog alert = builder.create();
alert.setMessage(etDesc.getText().toString());
alert.setCanceledOnTouchOutside(true);
WindowManager.LayoutParams wmlp = alert.getWindow().getAttributes();
wmlp.gravity = Gravity.CENTER ;
wmlp.x = 100; //x position
wmlp.y = 100; //y position
alert.show();
}