Note that there are some explanatory texts on larger screens.

plurals
  1. POi didn't get my Latitude and Longitude in my MapView?
    primarykey
    data
    text
    <p>Here I wrote code for getting lat and long values in my mapview activity, but its getting forced closed is there any modification or other methods to get these?</p> <pre><code>public class GpsoverlayActivity extends Activity { /** Called when the activity is first created. */ MapView map; MapController mc; GeoPoint gp; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); map=(MapView)findViewById(R.id.mapView); mc=map.getController(); mc.setCenter(gp); mc.setZoom(20); } protected boolean onTap(int i) { OverlayItem item=getItem(i); GeoPoint geo=item.getPoint(); Point pt=map.getProjection().toPixels(geo, null); String message=String.format("Lat: %f | Lon: %f\nX: %d | Y %d", geo.getLatitudeE6()/1000000.0, geo.getLongitudeE6()/1000000.0, pt.x, pt.y); Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show(); return(true); } private OverlayItem getItem(int i) { // TODO Auto-generated method stub return null; } } </code></pre> <p>here this is my LogCat for above code...</p> <pre><code>12-22 14:50:33.912: D/ddm-heap(834): Got feature list request 12-22 14:50:34.252: E/ActivityThread(834): Failed to find provider info for com.google.settings 12-22 14:50:34.271: E/ActivityThread(834): Failed to find provider info for com.google.settings 12-22 14:50:34.352: E/ActivityThread(834): Failed to find provider info for com.google.settings 12-22 14:50:34.802: D/AndroidRuntime(834): Shutting down VM 12-22 14:50:34.812: W/dalvikvm(834): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 12-22 14:50:34.812: E/AndroidRuntime(834): Uncaught handler: thread main exiting due to uncaught exception 12-22 14:50:34.841: E/AndroidRuntime(834): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.emigostec/com.emigostec.GmapviewActivity}: java.lang.NullPointerException 12-22 14:50:34.841: E/AndroidRuntime(834): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 12-22 14:50:34.841: E/AndroidRuntime(834): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 12-22 14:50:34.841: E/AndroidRuntime(834): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 12-22 14:50:34.841: E/AndroidRuntime(834): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 12-22 14:50:34.841: E/AndroidRuntime(834): at android.os.Handler.dispatchMessage(Handler.java:99) 12-22 14:50:34.841: E/AndroidRuntime(834): at android.os.Looper.loop(Looper.java:123) 12-22 14:50:34.841: E/AndroidRuntime(834): at android.app.ActivityThread.main(ActivityThread.java:4363) 12-22 14:50:34.841: E/AndroidRuntime(834): at java.lang.reflect.Method.invokeNative(Native Method) 12-22 14:50:34.841: E/AndroidRuntime(834): at java.lang.reflect.Method.invoke(Method.java:521) 12-22 14:50:34.841: E/AndroidRuntime(834): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 12-22 14:50:34.841: E/AndroidRuntime(834): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 12-22 14:50:34.841: E/AndroidRuntime(834): at dalvik.system.NativeStart.main(Native Method) 12-22 14:50:34.841: E/AndroidRuntime(834): Caused by: java.lang.NullPointerException 12-22 14:50:34.841: E/AndroidRuntime(834): at com.emigostec.GmapviewActivity.onCreate(GmapviewActivity.java:24) 12-22 14:50:34.841: E/AndroidRuntime(834): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 12-22 14:50:34.841: E/AndroidRuntime(834): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 12-22 14:50:34.841: E/AndroidRuntime(834): ... 11 more 12-22 14:50:34.872: I/dalvikvm(834): threadid=7: reacting to signal 3 12-22 14:50:35.123: W/dalvikvm(834): threadid=7: spin on suspend #0 threadid=17 (h=1283560) 12-22 14:50:35.123: W/dalvikvm(834): dumping state: process - 834 12-22 14:50:35.123: I/dalvikvm(834): "Signal Catcher" daemon prio=5 tid=7 RUNNABLE 12-22 14:50:35.123: I/dalvikvm(834): | group="system" sCount=0 dsCount=0 s=N obj=0x44bf51e8 self=0x133828 12-22 14:50:35.123: I/dalvikvm(834): | sysTid=837 nice=0 sched=0/0 cgrp=default handle=1238520 12-22 14:50:35.123: I/dalvikvm(834): at dalvik.system.NativeStart.run(Native Method) 12-22 14:50:35.123: I/dalvikvm(834): "TrafficService" prio=1 tid=17 RUNNABLE 12-22 14:50:35.123: I/dalvikvm(834): | group="main" sCount=1 dsCount=0 s=N obj=0x44c184b8 self=0x11ec98 12-22 14:50:35.123: I/dalvikvm(834): | sysTid=842 nice=19 sched=0/0 cgrp=bg_non_interactive handle=1283560 12-22 14:50:35.123: I/dalvikvm(834): DumpRunning: Thread at 0x11ec98 has no curFrame (threadid=17) 12-22 14:50:35.162: W/dalvikvm(834): threadid=7: spin on suspend resolved in 293 msec 12-22 14:50:35.321: I/dalvikvm(834): Wrote stack trace to '/data/anr/traces.txt' </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload