Create Toast - Android User Interface

Android examples for User Interface:Toast

Description

Create Toast

Demo Code


import android.content.Context;
import android.content.res.Configuration;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.text.TextUtils;
import android.view.View;
import android.widget.Toast;

public class Main{
    public static void toast(@NonNull final Context context,
            @NonNull final String msg) {

        Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
    }//from   w  w w  . j  a  v a2 s  .c  om
}

Related Tutorials