Thanks for the response...

I've just saw it today...

this is my class declaration public class AsyncRequest<T> extends
AsyncTask<Object, Void, AsyncResponse<T>> {

using getTypeParameters
                TypeVariable<?>[] types = getClass().getTypeParameters();

types[0].getBounds()[0] is a class java.lang.Object

The only way I got it working is when instantiating my class
AsyncRequest<ResponseDTO> asyncRequest = new
AsyncRequest<ResponseDTO>(mContext, asyncResponseListener){};

Using an empty anonymous inner class

LĂșcio Maciel
[email protected]



On Fri, Jun 10, 2011 at 03:13, Nikolay Elenkov
<[email protected]> wrote:
> On Thu, Jun 9, 2011 at 9:31 AM, luciofm <[email protected]> wrote:
>
>> In this case, with getSuperclassTypeParameter() I get the parameterized
>> types of AsyncTask, and not of my own Class AsyncRequest...
>> (parameterized.getActualTypeArguments()[0] is a String type).
>>
>
> That's the way  getGenericSuperclass() is supposed to work. Use
> getTypeParameters() to get the generic variables of the current class.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to