In my app i want to check whethere any other app launches or not from my app.So i am currently usimg Activitymanager to find the top activity like this
Act
The approach you are taking is wrong and prone to have your app rejected from the Google Play Store (plus it may stop working).
Check this thread to see possible ways to detect wether your app went to the background or not.