Skip to content
This repository
Browse code

droid: fix crash on startup on some devices

  • Loading branch information...
commit 49ccdbae2751e5214c43f3401cedf394259dff10 1 parent caf951b
authored May 23, 2013

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. 9  xbmc/android/jni/BroadcastReceiver.cpp
9  xbmc/android/jni/BroadcastReceiver.cpp
@@ -34,7 +34,14 @@ CJNIBroadcastReceiver::CJNIBroadcastReceiver(CJNIContext *context) : CJNIBase("o
34 34
 
35 35
 void CJNIBroadcastReceiver::InitializeBroadcastReceiver()
36 36
 {
37  
-  m_object = new_object(jni_app_context->getClassLoader().loadClass(GetClassName()));
  37
+  // Convert "the/class/name" to "the.class.name" as loadClass() expects it.
  38
+  std::string className = GetClassName();
  39
+  for (std::string::iterator it = className.begin(); it != className.end(); ++it)
  40
+  {
  41
+    if (*it == '/')
  42
+      *it = '.';
  43
+  }
  44
+  m_object = new_object(jni_app_context->getClassLoader().loadClass(className));
38 45
   m_object.setGlobal();
39 46
 }
40 47
 

0 notes on commit 49ccdba

Please sign in to comment.
Something went wrong with that request. Please try again.