diff options
author | Cory Fields <theuni-nospam-@xbmc.org> | 2013-05-23 14:49:06 -0400 |
---|---|---|
committer | Cory Fields <theuni-nospam-@xbmc.org> | 2013-05-23 14:49:06 -0400 |
commit | 49ccdbae2751e5214c43f3401cedf394259dff10 (patch) | |
tree | 3c146f5c473dce4489bb50f7a79dea87ba5cd5ec | |
parent | caf951bbdf166e01ad6f76aad4c5fe5803d5204f (diff) |
droid: fix crash on startup on some devices
-rw-r--r-- | xbmc/android/jni/BroadcastReceiver.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xbmc/android/jni/BroadcastReceiver.cpp b/xbmc/android/jni/BroadcastReceiver.cpp index 0390036c22..902f1567d5 100644 --- a/xbmc/android/jni/BroadcastReceiver.cpp +++ b/xbmc/android/jni/BroadcastReceiver.cpp @@ -34,7 +34,14 @@ CJNIBroadcastReceiver::CJNIBroadcastReceiver(CJNIContext *context) : CJNIBase("o void CJNIBroadcastReceiver::InitializeBroadcastReceiver() { - m_object = new_object(jni_app_context->getClassLoader().loadClass(GetClassName())); + // Convert "the/class/name" to "the.class.name" as loadClass() expects it. + std::string className = GetClassName(); + for (std::string::iterator it = className.begin(); it != className.end(); ++it) + { + if (*it == '/') + *it = '.'; + } + m_object = new_object(jni_app_context->getClassLoader().loadClass(className)); m_object.setGlobal(); } |