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. How can I package shared libs only into apk

You should use the NDK.  If you are compiling as a platform component,
things are very different, and you won't have you code inside of a .apk.










-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

2. How to categorize the installed applications similar to Android Market

Sorry, there is no way to do this -- that information is currently just
internal to the market app, not part of the platform at all.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

3. How can solve this error? Please help me :)

4. How can solve this error? Please help me :)

5. How to add a view to application layout programmatically

6. Master Clear From Code does not work

7. detecting application loss of screen control