There is a MainActivity that I want to open by reference. For this, I wrote in the manifest:
<activity android:name=".MainActivity" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="mysite.net"/> </intent-filter> </activity>
Processing in MainActivity:
@Override protected void onResume(){ super.onResume(); if(getIntent().getData() != null) { showSomething(getIntent().getData().toString()); } }
Question: why, if the application is in the background, I get an Intent with a zero date, and if the application is closed, then I get the necessary data perfectly?