For those who helped me out earlier regarding this project, thank you very much! My code no longer has any problems, and I made extra tweaks. Now that the app is actually ro
None of the answers did the job to me, i made a combination of the above answers and I got the solution down.
The second timer is the target view.
public static void displayToastUnderView(Activity activity, View view, String text) {
Toast toast = Toast.makeText(activity, text, Toast.LENGTH_SHORT);
toast.setGravity( Gravity.TOP, view.getLeft() - view.getWidth() / 2 - toast.getView().getWidth() / 2, view.getBottom());
toast.show();
}