I was study about Firebase's click_action
use to open activity on notification click when app was killed. It's work fine! But after closing app open app normally(Not from notification)
but its open same activity as specified in click_action
.
Here is the code in manifest for launch screen :
<activity
android:name=".activity.SplashScreen"
android:screenOrientation="portrait"
android:theme="@style/LoginScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
And for Firebase notification :
<activity android:name=".activity.RequestsActivity">
<intent-filter>
<action android:name="RequestsActivity" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
Code for Application exit when get back to home screen then :
@Override
public void onBackPressed() {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
System.exit(0);
}
Flow of current screen
Notification->Click->RequestActivity->Back_Click->HomeScreen->BackClick->Exit_App->Reopen_App->RequestActivity(But it must be HomeScreen!).