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

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -