android - How to declare function which accepts Generic AsyncTask as an argument -
I have many actions and in my application, AsyncTasks I want to define an interface that is a normal async task and Accepts Boolean. I will implement that interface in all the activities and want to call the interface method asyncTask.
How should I declare a method to accept all the sub-classes of asynchronous? I want to make it normal so that I can know that to use the example operator which is called an override method in asyncTask activity. I tried to use:
public onupdate (AsyncTask & lt; param, progress, result & gt; jobs, boolean show); but not allowed.
You can declare it by the way:
Update on Public Zero (AsyncTask & lt;?,?,? & Gt; Function, Boolean Show) {} Then you can use it by expanding a AsyncTask : Private Class SomeTask AsyncTask and lt; String, integer, long & gt; {@Override protected long doInBackground (string ... parameter) {// TODO auto generated method stub returns empty; }} and calling your method:
onUpdate (new something (task), true);
Comments
Post a Comment