package com.sunteam.ebook.util;

import android.content.Context;
import android.os.Handler;
import android.widget.Toast;

/**
 * 自定义Toast类。
 * 
 * @author wzp
 */
public class CustomToast 
{
	private static Toast mToast;
    private static Handler mHandler = new Handler();
    private static Runnable r = new Runnable() {
        public void run() 
        {
            mToast.cancel();
        }
    };

    public static void showToast(Context mContext, String text, int duration) 
    {
    	mHandler.removeCallbacks(r);
    	if (mToast != null)
    	{
    		mToast.setText(text);
    	}
    	else
    	{
    		mToast = Toast.makeText(mContext, text, duration);
    	}
    	
    	mHandler.postDelayed(r, 3000);
    	mToast.show();
    }

    public static void showToast(Context mContext, int resId, int duration) 
    {
    	showToast(mContext, mContext.getResources().getString(resId), duration);
    }
}	

@@ -26,16 +26,71 @@
 .util;%0A%0A
+import com.sunteam.common.utils.PromptDialogNospeech;%0A%0A
 import a
@@ -143,37 +143,8 @@
 ler;
-%0Aimport android.widget.Toast;
 %0A%0A/*
@@ -230,20 +230,50 @@
 tic 
-Toast mToast
+PromptDialogNospeech mPromptDialogNospeech
 ;%0A  
@@ -421,27 +421,78 @@
     
-    mToast.cancel()
+%09mPromptDialogNospeech.cancel();%0A        %09mPromptDialogNospeech = null
 ;%0A  
@@ -636,21 +636,36 @@
   %09if (m
-Toast
+PromptDialogNospeech
  != null
@@ -684,21 +684,37 @@
  %09%09m
-Toast
+PromptDialogNospeech
 .setT
-ext
+itle
 (tex
@@ -752,31 +752,57 @@
  %09%09m
-Toast = Toast.makeText(
+PromptDialogNospeech = new PromptDialogNospeech( 
 mCon
@@ -811,26 +811,17 @@
 xt, text
-, duration
+ 
 );%0A    %09
@@ -861,10 +861,10 @@
 (r, 
-30
+15
 00);
@@ -870,21 +870,36 @@
 ;%0A    %09m
-Toast
+PromptDialogNospeech
 .show();

修改自定义Toast.