can any one please tell me what is the problem with this logcat please
06-23 11:09:12.060: ERROR/AndroidRuntime(1116): FATAL EXCEPTION: Speedometer
06-23 11:09:12.060: ERROR/AndroidRuntime(1116): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
06-23 11:09:12.060: ERROR/AndroidRuntime(1116): at android.os.Handler.<init>(Handler.java:121)
06-23 11:09:12.060: ERROR/AndroidRuntime(1116): at android.widget.Toast.<init>(Toast.java:68)
06-23 11:09:12.060: ERROR/AndroidRuntime(1116): at android.widget.Toast.makeText(Toast.java:231)
06-23 11:09:12.060: ERROR/AndroidRuntime(1116): at com.paad.whereami.WhereAmI.updateGUI(WhereAmI.java:883)
06-23 11:09:12.060: ERROR/AndroidRuntime(1116): at com.paad.whereami.WhereAmI.access$5(WhereAmI.java:860)
06-23 11:09:12.060: ERROR/AndroidRuntime(1116): at com.paad.whereami.WhereAmI$4.run(WhereAmI.java:845)
06-23 11:09:12.060: ERROR/AndroidRuntime(1116): at java.util.Timer$TimerImpl.run(Timer.java:284)
Yoi will need to show toast from ui thread. You can do it using runOnUiThread method on Activity. Here is an explanation with example Android: Toast in a thread
You're trying to start an Android event handler such as onLocationChanged inside a new thread that you created. In the "run()" method of the thread class, you need to call Looper.prepare(), register the event handler, then call Looper.loop(). When you're done with the thread, call the Looper.myLooper().quit() method to exit.
Example: