In MainActivity, I call SincActivity. This screen has a "start" button, a TextView and a ProgressBar to show the status.
The button start an AsyncTask. This AsyncTask updates the components on the screen, and also in the notification area.
The notification area can be clicked. I passed into their creation which Activity it should open. I have spent SincActivity.
When the user is on the screen SincActivity and click the button, all components are updated as expected.
When I click on the notification area, android opens a new screen SincActivity, with initial values.
It's as if somewhere, android execute: "new SincActivity"; What I need is to be shown always the same screen.. the same instance. Almost like a singleton.
Is this possible?
UPDATE
AndroidManifest.xml
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="br.com.rokko.gabinetemobile.MainActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/FullscreenTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="br.com.rokko.gabinetemobile.ModeloActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_modelo"
android:theme="@style/FullscreenTheme" >
</activity>
<activity
android:name="br.com.rokko.gabinetemobile.SincActivity"
android:label="@string/sincronizacao" ><!-- android:launchMode="singleInstance" don't work -->
</activity>
</application>