mardi 15 novembre 2016

How to retrieve the Class Type of the Parametrized type T

public GenericRequest(Response.Listener<T> listener){

     Class<T> clazz = ???

}

How to do i get the clazz Variable knowing the Response.Listener is an Interface.

   /** Callback interface for delivering parsed responses. */
    public interface Listener<T> {
        /** Called when a response is received. */
        public void onResponse(T response);
    }





Aucun commentaire:

Enregistrer un commentaire