The following piece of code successfully transfers the putExtra value when the app is not running in the instant
version. However, when I switch to the instant module, the intent does not transfer it. Any idea what I'm doing wrong? I tried going through the instant apps FAQ and saw some sample instant apps code, but couldn't find a solution.
Intent intent = new Intent();
String packageName = "com.example";
String className = "com.example.InfoActivity";
if(InstantApps.isInstantApp(getApplicationContext()))
{
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://www.example.com/instant/info"));
}
else {
intent.setClassName(packageName, className);
}
intent.putExtra("value", 2);
startActivity(intent);
The links have been mapped to URLs, and the activity opens, however the data is not passed through.