java - How do I create a superclass that extends AsyncTask? -
i have extend android class android.os.asynctask (params, progress, result). have add new methods , class variables without setting (params, progress, result) in superclass, types defined children.
asynctask <params, progress, result> | superclass <params, progress, result> | ┌───┴───────────────┬───────────────────┐ | | | child1 <integer, void, integer> | | | | child2 <jsonobject, void, integer> | | child3 <string, void, integer>
how implement this?
you can inherit generic classes same way inherit regular classes.
the inherited class can specify concrete types type parameters, or own generic type arguments.
public abstract class customasynctask <params, progress, result> extends asynctask <params, progress, result>
Comments
Post a Comment