title: How to check if my application is running in android(not as a service)?
body: <p><strong>Problem:</strong>
  I have to check if my app is running or not(when a service is already running in background). Based on it I am suppose to either start particular activity or the app.</p>
  
  <p><strong>Thing I tried or come up with but failed</strong>
  I tried to check current running process and based on it tried to decide if app is running or not.
  Reason for failure: Get app running status as always true since I already had service running in background.</p>
  
  <p><strong>Possible solution but not sure if that possible in android</strong>
  1. If we can run service by different name(package name)
  2. Set some boolean value to true and false on app start and close respectively. But is this a good approach?</p>
  
  <p><strong>EDIT::</strong></p>
  
  <p>Sorry if I wasn't very descriptive earlier. I try to explain you what exactly I'm trying to acheive.</p>
  
  <p>Whenever user click on notification. I have to do any one out of two option after checking if my app is launched(excluding services since they are always running in the background).
  1. If my app is already launched just start the required activity.
  2. If app is not launched then I have to launch it and then open the required activity.</p>
  
  <p>e.g 
  I get a message arrival notification. If my application is launched I have to show inbox otherwise I have to launch my application and then open the inbox.</p>