Java tutorial
//package com.java2s; import android.content.Context; import android.widget.Toast; public class Main { public static void showWaningToast(Context context, String str) { if (context == null) return; try { Toast.makeText(context, str, Toast.LENGTH_LONG).show(); } catch (Exception e) { } } }