Permalink
Browse files

Merge pull request #3740 from koying/fixdroidextplayer

FIX: External Player support for Android. See: http://forum.xbmc.org/sho...
  • Loading branch information...
2 parents d289d19 + 10f605d commit 27834c62085d4b706e3597a23711335f5f5fbff2 @koying koying committed Dec 1, 2013
Showing with 20 additions and 5 deletions.
  1. +20 −5 xbmc/android/activity/XBMCApp.cpp
View
25 xbmc/android/activity/XBMCApp.cpp
@@ -401,17 +401,32 @@ bool CXBMCApp::HasLaunchIntent(const string &package)
// Note intent, dataType, dataURI all default to ""
bool CXBMCApp::StartActivity(const string &package, const string &intent, const string &dataType, const string &dataURI)
{
- CJNIIntent newIntent = GetPackageManager().getLaunchIntentForPackage(package);
+ CJNIIntent newIntent = intent.empty() ?
+ GetPackageManager().getLaunchIntentForPackage(package) :
+ CJNIIntent(intent);
+
if (!newIntent)
return false;
if (!dataURI.empty())
- newIntent.setData(dataURI);
+ {
+ CJNIURI jniURI = CJNIURI::parse(dataURI);
+
+ if (!jniURI)
+ return false;
+
+ newIntent.setDataAndType(jniURI, dataType);
+ }
- if (!intent.empty())
- newIntent.setAction(intent);
+ newIntent.setPackage(package);
+ startActivity(newIntent);
+ if (xbmc_jnienv()->ExceptionOccurred())
+ {
+ CLog::Log(LOGERROR, "CXBMCApp::StartActivity - ExceptionOccurred launching %s", package.c_str());
+ xbmc_jnienv()->ExceptionClear();
+ return false;
+ }
- startActivity(newIntent);
return true;
}

0 comments on commit 27834c6

Please sign in to comment.