1
我有companydetails.java每它的墜毀Android的谷歌地圖保持崩潰
case R.id.textView:
if (!((String) this.companyMap.get("latitude")).equals("") || !
((String) this.companyMap.get("longitude")).equals("")) {
intent = new Intent(this, MapActivity.class);
intent.putExtra("latitude", Double.parseDouble((String)
this.companyMap.get("latitude")));
intent.putExtra("longitude", Double.parseDouble((String)
this.companyMap.get("longitude")));
intent.putExtra("company", (String)
this.companyMap.get("company"));
break;
}
這個時間代碼和我得到了這些錯誤
設備日誌
00:43:49 E AndroidRuntime : FATAL EXCEPTION: main
00:43:49 E AndroidRuntime : Process: com.mra.tnow, PID: 9186
00:43:49 E AndroidRuntime : java.lang.NumberFormatException: For input string: "28°23′50"
00:43:49 E AndroidRuntime : at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1306)
00:43:49 E AndroidRuntime : at java.lang.Double.parseDouble(Double.java:547)
00:43:49 E AndroidRuntime : at com.marwan.tabuknow.CompanyDetails.onClick(CompanyDetails.java:368)
00:43:49 E AndroidRuntime : at android.view.View.performClick(View.java:5637)
00:43:49 E AndroidRuntime : at android.view.View$PerformClick.run(View.java:22429)
00:43:49 E AndroidRuntime : at android.os.Handler.handleCallback(Handler.java:751)
00:43:49 E AndroidRuntime : at android.os.Handler.dispatchMessage(Handler.java:95)
00:43:49 E AndroidRuntime : at android.os.Looper.loop(Looper.java:154)
00:43:49 E AndroidRuntime : at android.app.ActivityThread.main(ActivityThread.java:6121)
00:43:49 E AndroidRuntime : at java.lang.reflect.Method.invoke(Native Method)
00:43:49 E AndroidRuntime : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
00:43:49 E AndroidRuntime : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
現在我得到這個錯誤05:34:22 E AndroidRuntime:java.lang.RuntimeException:無法啓動活動ComponentInfo {com.mar.tnow/com.mar.tnow.MapActivity}:java.lang.NullPointerException:嘗試在空對象引用 –
上調用虛方法'com.google.android.gms.maps.GoogleMap com.google.android.gms.maps.MapFragment.getMap()'我搜索了一下,我認爲這個問題可能是通過[this]解決(https://stackoverflow.com/a/31088204/7673764) –