javaandroidandroid-toast

Toast Error , xOffsets-yOffsets problem Toast Problem


Hello Friends I hope all will be well Dear brothers i have been facing an error of offset in simple gravity toast enter image description here


Solution

  • use setGravity method

    Toast toast =  Toast.makeText(this, "Hello", Toast.LENGTH_SHORT);
    toast.setGravity(Gravity.CENTER, 0, 0);
    toast.show();