package com.game.webgame.network;
import android.content.Context;
import com.android.volley.VolleyError;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;

public abstract class Volleyinterface1 {
	public Context mcontext;
	public static Listener<String> mlistener;
	public static ErrorListener mErrorLisener;

	public Volleyinterface1(Context context, Listener<String> mlistener,
			ErrorListener errorlisener) {
		this.mcontext = context;
		this.mErrorLisener = errorlisener;
		this.mlistener = mlistener;

	}

	public abstract void onsuccess(String result);

	public abstract void onerror(VolleyError arg0);

	public Listener<String> loadinglisener() {
		mlistener = new Listener<String>() {

			@Override
			public void onResponse(String arg0) {
				onsuccess(arg0.toString());
			}
		};
		return mlistener;
	}
	public ErrorListener errorListener() {
		mErrorLisener = new ErrorListener() {
			@Override
			public void onErrorResponse(VolleyError arg0) {
				onerror(arg0);
			}

		};
		return mErrorLisener;
	}
}
