You dont need write extra code.Supose if Activity A is already running,dont want to lunch another same Activity.So you just declare android manifest file like this.
<activity android:name=".com.app.ActivityA" android:launchMode="singleTask" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait"></activity>
Yes of-course the fragment is good options instead of launch new activity.