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 to disable sms notification?

I'm trying to use my own app to handle one incoming message with some
specific characters in it. And I don't want the system's
default sms notifications to show up.

How can I do this?

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

2. RTC_WAKEUP

I thought that the intention for the RTC_WAKEUP alarm was to wake up a
sleeping or powered off device. I was a bit surprised to find out that
it was not only the Alarm Clock application that registered RTC_WAKEUP
alarms, but also the Calendar does this to drive its synchronization.
I assume the GMail application uses the same technique.

This means that I cannot use RTC_WAKEUP alarms on my hardware to
program an RTC to power on a device on an alarm. Because if I did it
would also power up the device when a synchronization activity is
scheduled, the device would stay powered up, the battery power would
eventually be exhausted, possibly long before the alarm set in the
Alarm Clock app is reached.

Is this the intended behaviour, or am I assuming to much that the
intention for Android was to support alarms to power up a device and
sound an alarm as many classic feature phones have supported almost
since time immemorial? If this wasn't intended then there needs to be
a new RTC category of alarms that does power up the device, and only
alarms set in the Alarm Clock or a Calendar event with a reminder can
trigger it.

TIA

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. How to add my own menu item into the already existing menu in the sms application

4. Syurtype dictionary Indonesia

5. Low Battery Warning

6. How to see user comments from multiple languages

7. Views right of long SingeLine Textviews disappear