Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve the issue with load the second app inside the same app for android #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/android/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,18 @@ private void launchAppWithData(final String packageName, final String uri, final
final CallbackContext callbackContext = this.callback;
cordova.getThreadPool().execute(new LauncherRunnable(this.callback) {
public void run() {
Intent intent = new Intent(Intent.ACTION_VIEW);
PackageManager pm = plugin.webView.getContext().getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(packageName);
intent.setAction(Intent.ACTION_VIEW);

// Here I have replaced the below line with above three lines since it was loading the second app inside the first app.
// Now it load as a seperate app!
// Intent intent = new Intent(Intent.ACTION_VIEW);
if (dataType != null) {
intent.setDataAndType(Uri.parse(uri), dataType);
} else {
intent.setData(Uri.parse(uri));
}

if (packageName != null && !packageName.equals("")) {
intent.setPackage(packageName);
}

intent.putExtras(extras);

try {
Expand Down