@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { Log.d( TAG, "onActivityResult. requestCode: " + requestCode + " resultCode: " + resultCode + " data: " + data); Uri uri = data.getData(); if (null == uri) { return; } String path = uri.toString(); if (!TextUtils.isEmpty(path)) { try { if (path.startsWith("file:///")) { path = path.substring("file://".length()); } Log.d(TAG, "path: " + path); FelixWrapper.getInstance(this) .getFramework() .getBundleContext() .installBundle(path, new FileInputStream(new File(path))); updateUI(); } catch (BundleException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } super.onActivityResult(requestCode, resultCode, data); }
private void syncWithOsgi() { Framework f = FelixWrapper.getInstance(null).getFramework(); mBundles = f.getBundleContext().getBundles(); }