Hi All,

I'm getting the exception below from some of my testers phones.

It's a call to a static Android method, and I don't actually see an exception 
message, just a call stack (the logger calls ToString() on the exception). 


My only idea is that I'm using Application.Context  in the call and I've 
seen/read that that can cause some issues. I'll try that when I get on to my 
dev PC, but open to any ideas.




2012-10-12 10:58:21.360 E 11853/SplashPresenter: 5 Failed to start
Java.Lang.Throwable: Exception of type 'Java.Lang.Throwable' was thrown.
  at Android.Runtime.JNIEnv.CallStaticObjectMethod (IntPtr jclass, IntPtr 
jmethod, Android.Runtime.JValue[] parms) [0x00000] in <filename unknown>:0 
  at Android.Preferences.PreferenceManager.GetDefaultSharedPreferences 
(Android.Content.Context context) [0x00000] in <filename unknown>:0 
  at com.xxx.android.AndroidSettingsProvider.Load () [0x00000] in <filename 
unknown>:0 
  at xxx.Lib.SplashPresenter.RunStartupTasksAsync (System.Object state) 
[0x00000] in <filename unknown>:0 
  --- End of managed exception stack trace ---
java.lang.NullPointerException
    at 
android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:371)
    at 
android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:366)
    at dalvik.system.NativeStart.run(Native Method)



void RunStartupTasksAsync (object state)  {  try  {  try  {  _log.Debug (Tag, 
"Running startup tasks...");  UnpackDb ();  ConnectDb ();  SmokeTestDb ();  
_settings.Load();   //Go to search screen  View.InvokeOnGuiThread (() =>  {  
View.NavigateToWordSearch ();  });  } catch (Mono.Data.Sqlite.SqliteException 
ex)  {  _log.Error (Tag, "Db smoke test failed. Will attempt to rebuild...", 
ex);  _unpacker.Delete (Constants.DATABASE_NAME);  View.InvokeOnGuiThread (() 
=> View.ShowCorruptDatabaseDialog ());  }    } catch (Exception ex)  {  
_log.Error (Tag, "Failed to start", ex);  View.InvokeOnGuiThread (() => 
View.ShowCorruptDatabaseDialog ());  }  }


...

public override void Load()  {  var prefs = 
PreferenceManager.GetDefaultSharedPreferences(Application.Context);   
this.Update(Settings.TextSizeKey, prefs.GetString(Settings.TextSizeKey, "16")); 
 this.Update(Settings.LinkWordsKey, prefs.GetBoolean(Settings.LinkWordsKey, 
false).ToString());  }
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to