Check out example codes for "android java how to stop activity from opening twice programatically". It will help you in understanding the concepts better.

Code Example 1

intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

Learn ReactJs, React Native from akashmittal.com