Note that there are some explanatory texts on larger screens.

plurals
  1. POApp crashes when it reaches myMapView.getController()
    primarykey
    data
    text
    <p>For some reason this VERY simple program crashes when it reaches the getController() method. Its almost like the debugger is trying to tell me something, but its all garble.Believe it or not there isn't a clear explanation or exception given, ha. But it definitely blows up on this line. If I take it out of the code the app will run a basic map. I have tried everything imaginable and I can't figure out the problem. Does anyone have any thoughts? Thanks in advance.</p> <blockquote> <p>public class Main extends MapActivity {</p> </blockquote> <pre><code>MapView myMapView; MapController mc; GeoPoint point; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); double lon = -79.9; double lat = 40.4; myMapView = (MapView) findViewById(R.layout.main); point = new GeoPoint((int) (lat * 1E6), (int) (lon * 1E6)); mc = myMapView.getController(); mc.animateTo(point); mc.setZoom(13); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } </code></pre> <p>And the main.xml code:</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;com.google.android.maps.MapView android:layout_width="fill_parent" android:layout_height="fill_parent" android:enabled="true" android:clickable="true" android:apiKey="0SN6PntBTxgMIeekPQm2Of1gnlDiHmrTm8GG2xQ" &gt;&lt;/com.google.android.maps.MapView&gt; &lt;/LinearLayout&gt; </code></pre> <p>And Finally, the manifest.xml code:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.simplyDesign.BarCraw" android:versionCode="1" android:versionName="1.0"&gt; &lt;uses-sdk android:minSdkVersion="4" /&gt; &lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".Main" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;/application&gt; &lt;/manifest&gt; </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.
    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