Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

droid: fix crash on startup on some devices

  • Loading branch information...
commit 49ccdbae2751e5214c43f3401cedf394259dff10 1 parent caf951b
Cory Fields authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 xbmc/android/jni/BroadcastReceiver.cpp
9 xbmc/android/jni/BroadcastReceiver.cpp
View
@@ -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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.