I get data asynchrounsly and this data gets plotted, got the logic worked out and now of course I need to run this smootthly so I use an AsyncTask when I get more data it is digested to a bitmap and plotted accordingly of course running on a loop without the AsyncTask works but on slower/older devices it is slugish, with the ASyncTask it seems like there is some sort of overrun as the bitmap/ImageView flickers
The items come in 5 different flavours so I set my parms properly when I make a new instance of the Asynctask and call execute to run a new instance of it
Now if a particular task for a specific flavour is running already how to check that??? so that I skip it until it finish processing the data for that type??? I needed to pass different data types so I used a list of Objects and that works
I know KISS is to make 5 different instances of the AsyncTask and check the taskInstance_n.getStatus() != AsyncTask.Status.RUNNING but I thought there may be a cleaner/cooler generic way to do it ????
ArrayList<Object>parms = new ArrayList<Object>
...
do
{
..grab the data ...
switch(id)
{
case 0:
parms.clear();
parms.add(arg1);
parms.add((type1)arg2)
parms.add((type2)arg3)
if( ! task is running with arg1) ---->how do I do this
new myAsyncTask().execute(parms,null,null);
break;
case 1:
... other 4 choices simar way to call it
} // end of switch
...
}while(i_get_data)