0
我在帖子中看到了How to open an application inside another application within the latters boundaries in android?使用自定義URL方案啓動另一個應用程序會在啓動應用程序的邊界內打開應用程序。
但是,當我嘗試使用自定義URL方案打開另一個應用程序時,它發生在我的應用程序中。有誰知道爲什麼會發生這種情況?
調用其他應用程序的代碼如下。
String callBackUrl = 「OtherApp://result?params」; // This is supposed to be a callback URL with query parameters
String redirectUrl = callBackUrl.substring(0, callBackUrl.indexOf("://"));
Intent redirectIntent = new Intent();
redirectIntent.putExtra(Intent.EXTRA_TEXT, callBackUrl);
redirectIntent.setAction(redirectUrl);
redirectIntent.setType("text/plain");
startActivity(redirectIntent);