@@ -0,0 +1,1314 @@
+package enyx.ch.politapp.helper;%0A%0Aimport android.app.Activity;%0Aimport android.support.annotation.IntDef;%0Aimport android.widget.Toast;%0A%0Aimport java.lang.annotation.Retention;%0Aimport java.lang.annotation.RetentionPolicy;%0A%0Aimport enyx.ch.politapp.activity.MainActivity;%0A%0A/**%0A * Created by adrien.manikon on 25.06.15.%0A */%0Apublic class ToastHelper %7B%0A%0A    /** @hide */%0A    @IntDef(%7BToast.LENGTH_SHORT, Toast.LENGTH_LONG%7D)%0A    @Retention(RetentionPolicy.SOURCE)%0A    public @interface Duration %7B%7D%0A%0A    private static ToastHelper _instance;%0A%0A    private Toast toast;%0A%0A    public static ToastHelper getInstance() %7B%0A%0A        if (_instance == null) %7B%0A            _instance = new ToastHelper();%0A        %7D%0A%0A        return _instance;%0A    %7D%0A%0A%0A    public void showMessage(Activity mContext, int idMessage, @Duration int duration) %7B%0A%0A        cleanToast();%0A        toast = Toast.makeText(mContext, idMessage, duration);%0A        toast.show();%0A%0A    %7D%0A%0A    public void showMessageShort(Activity mContext, int idMessage) %7B%0A        showMessage(mContext, idMessage, Toast.LENGTH_SHORT);%0A    %7D%0A%0A    public void showMessageLong(Activity mContext, int idMessage) %7B%0A        showMessage(mContext, idMessage, Toast.LENGTH_LONG);%0A    %7D%0A%0A    private void cleanToast() %7B%0A%0A        if (toast != null) %7B%0A            toast.cancel();%0A        %7D%0A%0A    %7D%0A%7D%0A

create toast class