makeText
method takes three parameters: the application context
, the text
message, and the duration
for the toast. It returns a properly initialized Toast object. You can display the toast notification with show()
, as shown in the following example:
Context context = getApplicationContext();
CharSequence text = "Hello toast!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
In your case, you were missing the duration
and the show()
, add them like this and it will work:
Toast.makeText(
HomeActivity.this,
""+accountKitError.getErrorType().getMessage(),
Toast.LENGTH_SHORT
).show();
Here is a link to the docs for more information about Toasts:
https://developer.android.com/guide/topics/ui/notifiers/toasts#java