I'm creating an application and want to put a message using Toast. But when creating the toast the same is only at the bottom of the activity. To centralize 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 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