system crash when enable mock location on My Samsung i9000 2.2(ZSJPE)

by Evan » Tue, 09 Nov 2010 02:54:34 GMT


Sponsored Links
 Dear all
I got a crash from logcat when I enable mock location in my program.
when I call enableMockLocation(true) but no update,the system is crash
and reboot.
the same program is working on 2.1(ZSJG4)

Exeception:

11-08 15:57:23.474: ERROR/AndroidRuntime(7336): *** FATAL EXCEPTION IN
SYSTEM PROCESS: GpsLocationProvider
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):
java.lang.NullPointerException
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider$HybridGps.access
$900(GpsLocationProvider.java:1676)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider.stopNavigating(GpsLocationProvider.java:
1227)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider.handleEnableLocationTracking(GpsLocationProvider.java:
968)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider.access
$7600(GpsLocationProvider.java:116)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider
$ProviderHandler.handleMessage(GpsLocationProvider.java:2224)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
android.os.Handler.dispatchMessage(Handler.java:99)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
android.os.Looper.loop(Looper.java:123)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider
$GpsLocationProviderThread.run(GpsLocationProvider.java:2263)

the partial code is:
    public void enableMockLocation(boolean bEnable) {

        m_bMockLocation = bEnable;
        if(m_bMockLocation)
        {
            Log.e(LOG_TAG, "enableMockLocation 01");
            m_Handler.obtainMessage(MSG_TOAST,"Mock location
enable.").sendToTarget();
            m_LocationManager.addTestProvider(m_szMockProvider,
                    false,    // requiresNetwork
                    true,    // requiresSatellite
                    false,    // requiresCell
                    false,    // hasMonetaryCost
                    false,    // supportsAltitude
                    false,    // supportsSpeed
                    false,    // supportsBearing
                    0,        // powerRequirement
                    5);       // accuracy
            Log.e(LOG_TAG, "enableMockLocation 03" +
m_szMockProvider);
            m_LocationManager.setTestProviderEnabled(m_szMockProvider,
true);
            Log.e(LOG_TAG, "enableMockLocation 04" +
m_szMockProvider);

        }else
        {
            m_Handler.obtainMessage(MSG_TOAST,"Mock location
disable.").sendToTarget();
            m_LocationManager.setTestProviderEnabled(m_szMockProvider,
false);
 
m_LocationManager.clearTestProviderEnabled(m_szMockProvider);
 
m_LocationManager.clearTestProviderLocation(m_szMockProvider);
 
m_LocationManager.clearTestProviderStatus(m_szMockProvider);
            m_LocationManager.removeTestProvider(m_szMockProvider);

        }
    }



any suggestion?
thanks

--



Other Threads

1. Incoming Call Event

Unfortunately, these features are not supported in the sdk. Though you will
be able to intercept outgoing calls in sdk 1.0 using
ACTION_NEW_OUTGOING_CALL.

2008/9/16 Pulkit Arora <[EMAIL PROTECTED]>



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

2. call reject

hi,
is it possible...call reject through coding in new sdk???
--~--~---------~--~----~------------~-------~--~----~

3. intercept an incoming in sdk1.0

4. About android first phone release

5. phone 2 phone game

6. Noobie problem with creating Classes which use other Classes

7. Announcement: Companies that announce Android support