HelloGoogleMaps : getting error instead of AlertDialog displa

by yodaa » Wed, 24 Feb 2010 23:23:19 GMT


Sponsored Links
 i,

I followed the Google Map View tutorial located at:
http://developer.android.com/resources/tutorials/views/hello-mapview.html

I'm running Eclipse Galileo (up to date) under Windows XP SP3.

The tutorial projet is runs within the emulator but clicking on one
of the drawable "androidmarker" positionned on the map leads to the
following Error message:

Sorry!
The applications HelloGoogleMaps (process com.tests) has stopped
unexpectedly. Please try again.

1 ) File :AndroidManifest.xml :
----------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tests"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".HelloGoogleMaps"
android:label="@string/app_name"

android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="7" />
</manifest>
2 ) File : res/layout/main.xml :
----------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="myapikey..." />

3 ) File : HelloGoogleMaps.java :
----------------------------------------------------
package com.tests;

import java.util.List;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

public class HelloGoogleMaps extends MapActivity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
List<Overlay> mapOverlays = mapView.getOverlays();
Drawable drawable =
this.getResources().getDrawable(R.drawable.androidmarker);
HelloItemizedOverlay itemizedoverlay = new
HelloItemizedOverlay(drawable);
GeoPoint point = new GeoPoint(19240000,-99120000);
OverlayItem overlayitem = new OverlayItem(point, "Hola,
Mundo!", "I'm in Mexico City!");
itemizedoverlay.addOverlay(overlayitem);



HelloGoogleMaps : getting error instead of AlertDialog displa

by TreKing » Thu, 25 Feb 2010 05:15:59 GMT


 




What's the stack trace at the point of the exception? That's your best bet.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
 http://sites.google.com/site/rezmobileapps/treking 

--


Sponsored Links


HelloGoogleMaps : getting error instead of AlertDialog displa

by yodaa » Sat, 27 Feb 2010 21:10:57 GMT


 hanks for your reply

I started the adb command line in the Windows XP shell:

C:\xxx\tools\adb logcat

and ran my "HelloGoogleMaps" project.The maps showed up within the
emulator with the androidmarker icon as ususal, I clicked on it and
encountered the error message mentionned earlier.

The log gave me the following "traces":

D/dalvikvm( 191): GC freed 875 objects / 121384 bytes in 214ms
D/AndroidRuntime( 191): Shutting down VM
W/dalvikvm( 191): threadid=3: thread exiting with uncaught exception
(group=0x4001b188)
E/AndroidRuntime( 191): Uncaught handler: thread main exiting due to
uncaught exception
D/dalvikvm( 191): GC freed 945 objects / 464808 bytes in 181ms
E/AndroidRuntime( 191): java.lang.NullPointerException
E/AndroidRuntime( 191): at
com.android.internal.app.AlertController
$AlertParams.<init>(AlertController.java:753)
E/AndroidRuntime( 191): at android.app.AlertDialog
$Builder.<init>(AlertDialog.java:273)
E/AndroidRuntime( 191): at
com.tests.HelloItemizedOverlay.onTap(HelloItemizedOverlay.java:45)
E/AndroidRuntime( 191): at
com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:
453)
E/AndroidRuntime( 191): at
com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)
E/AndroidRuntime( 191): at com.google.android.maps.MapView
$1.onSingleTapUp(MapView.java:346)
E/AndroidRuntime( 191): at
android.view.GestureDetector.onTouchEvent(GestureDetector.java:506)
E/AndroidRuntime( 191): at
com.google.android.maps.MapView.onTouchEvent(MapView.java:628)
E/AndroidRuntime( 191): at
android.view.View.dispatchTouchEvent(View.java:3709)
E/AndroidRuntime( 191): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:852)
E/AndroidRuntime( 191): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/AndroidRuntime( 191): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/AndroidRuntime( 191): at
com.android.internal.policy.impl.PhoneWindow$
DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
E/AndroidRuntime( 191): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1107)
E/AndroidRuntime( 191): at
android.app.Activity.dispatchTouchEvent(Activity.java:2061)
E/AndroidRuntime( 191): at
com.android.internal.policy.impl.PhoneWindow$
DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
E/AndroidRuntime( 191): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
E/AndroidRuntime( 191): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 191): at android.os.Looper.loop(Looper.java:
123)
E/AndroidRuntime( 191): at
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 191): at
java.lang.reflect.Method.invokeNative(NativeMethod)
E/AndroidRuntime( 191): at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 191): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 191): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 191): at
dalvik.system.NativeStart.main(Native Method)
I/Process ( 57): Sending signal. PID: 191 SIG: 3
I/dalvikvm( 191): threadid=7: reacting to signal 3
I/dalvikvm( 191): Wrote stack trac



Other Threads

1. API 1.5 to API 2.1

Hi All,

    I am working on an application which targets the 1.5 to 2.2 sets,
my problem is that I am using different resolution images with
drawables-* folders and it is not supported by the API 1.5, suggest me
what should I do?

    I am very thankful to you all guys :).

Yours,
Ali Hassan

-- 

2. how to froyo on galaxy s + root and benchmark vs. Froyo EVO

Akhirnya berhasil ya :D
Linpack SGS kok cuman segitu mas?




-- 
"Indonesian Android Community [id-android]" 

3. newbe mau upgrade froyo

4. Sygic / GPS app di SGS?

5. Quadrant htc hd2 froyo

6. Samdroid1.2.x Pake kartu tri

7. ASLA multiple stream at a time