I simply want that my activity has only one instance. I read about intent flags and launchmodes, but it just refuses to work.
I tried SingleTask, SingleTop, various intent flags etc. etc.
My manifest:
<activity
android:name="com.secret.domain.Player"
android:label="@string/title_activity_player"
android:launchMode="singleTask">
</activity>
and the launch code:
Intent intent = new Intent(getActivity(),Player.class);
intent.putExtra(Intent.EXTRA_TEXT,s);
intent.setData( Uri.parse( s ));
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
The Player activity obviously plays music, and still does it if I go back and create a new instance, both can play at the same time. OnNewIntent() is never called by the way.
I assume I've did something wrong, but I cant find out what.
EDIT: I know it sounds similar to other threads, but I read them and still couldn't figure out how to achieve what I want.