Burak İlçim Burak İlçim - 28 days ago 8
Android Question

when I clicked notification I want to continue app , not start an intent

I have a

Service
which listening the socket and when data came creating a notification. When users click the notification starting
MainActivity
, but I don't want to start an intent I just want to open app and continue. Because I am showing a map in
MainActivity
and when I started
MainActivity
with an intent it triggers
OnMapReady
function again.

Answer

You must look for android:launchMode tag. Please refer this page : activity-element

For instance in your AndroidManifest.xml :

<activity
    android:name=".activity.YasinActivity"
    android:configChanges="screenLayout|screenSize|orientation"
    android:label="blabla"
    android:launchMode="singleTask"
    android:theme="@style/AppTheme"
    android:windowSoftInputMode="stateAlwaysHidden" />