0
I’m creating an app and I want to post a message using Toast. But when creating Toast it only stays at the bottom of Activity. To center the message I tried to use this command line.
Toast.makeText(MainActivity.this, "Tarefa salva com sucesso!", Toast.LENGTH_SHORT);
Toast.setGravity(Gravity.CENTER,0,0, null);
Toast.show();
I’m using the latest version of android studio(3.2)
but it is not giving this error
error: method setGravity in class Toast cannot be applied to given types;
required: int,int,int
found: int,int,int,<null>
reason: actual and formal argument lists differ in length