Problem: 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.
Thing I tried or come up with but failed 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.
Possible solution but not sure if that possible in android 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?
EDIT::
Sorry if I wasn't very descriptive earlier. I try to explain you what exactly I'm trying to acheive.
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.
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.