I received this error.
Can not create handler inside thread that has not called Looper.prepare ()
Aim is to repeat the function that receives the map from 1000 to 1000 thousandths of a second.
Timer t = new Timer();
//Set the schedule function and rate
t.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
try {
recebemapa();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
},
//Set how long before to start calling the TimerTask (in milliseconds)
0,
//Set the amount of time between each execution (in milliseconds)
1000);
I call this code in method OnCreate()