Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asynctask, dimensions expected after this token

Im following the android docs on asynctask, trying to get an asynctask going that can perform actions on wifi in background, the issue im running into is at Asynctask in the code below, void and boolean or whatever i put there keep showing up as errors with the message "Dimensions expected after token". I dont know what this is referring to, everything above this section looks fine and works fine, couldnt find much on google either.

public class MainActivity extends Activity{
.......

class wifilistener extends AsyncTask<WifiManager,void,boolean> //trouble spot {

            protected void onPreExecute(){
                //show info on UI thread
            }



            protected boolean doInBackground(WifiManager...wifi1) {
                //do stuff
                }

            protected void onProgressUpdate(){

            }

                protected void onPostExecute(boolean result) {

                }
            }
}
like image 414
Finding Nemo 2 is happening. Avatar asked Aug 31 '12 07:08

Finding Nemo 2 is happening.


1 Answers

Try Void and Boolean; you have to use Object instead of primitive type for Asynctask. So, use uppercase V and B, and that should work.

like image 190
Infinity Avatar answered Oct 23 '22 09:10

Infinity