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

css - Text drops down with smaller window -

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

ruby on rails - Authlogic - how to make a registration and don't log in the new account? -