| | |
| | | package com.dayu.qiheonlinelibrary.utils; |
| | | |
| | | import android.content.Context; |
| | | import android.os.Handler; |
| | | import android.os.Looper; |
| | | import android.text.TextUtils; |
| | | import android.widget.Toast; |
| | | |
| | |
| | | public class ToastUtil { |
| | | |
| | | |
| | | public static void showToastLongOnMainLooper(final Context context, final String message) { |
| | | new Handler(Looper.getMainLooper()).post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Toast.makeText(context, message, Toast.LENGTH_LONG).show(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private static Toast makeText(Context context, CharSequence text, int duration) { |
| | | return Toast.makeText(context, text, duration); |
| | | } |