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) {
}
}
}
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With