aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Browet <koying@semperpax.com>2013-12-01 02:37:48 -0800
committerChris Browet <koying@semperpax.com>2013-12-01 02:37:48 -0800
commit27834c62085d4b706e3597a23711335f5f5fbff2 (patch)
treec399fed59d8ce792248448918093c5be5b374357
parentd289d194743a4d86497fc22e80b097774daf8f0f (diff)
parent10f605dd477a6017510215751bb71addb5366d1f (diff)
Merge pull request #3740 from koying/fixdroidextplayerGotham_alpha10
FIX: External Player support for Android. See: http://forum.xbmc.org/sho...
-rw-r--r--xbmc/android/activity/XBMCApp.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/xbmc/android/activity/XBMCApp.cpp b/xbmc/android/activity/XBMCApp.cpp
index 036601a0cc..1b95381410 100644
--- a/xbmc/android/activity/XBMCApp.cpp
+++ b/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;
}