how to check second instance of app
===

I am trying to check if their are anther instance of my app that is running.
My code is a app that tharts the original app that how I get 2 instans.
one be laughing the original and the second by laughing  the app that laughing  the original one.
when starts the second instant   I am getting always that my app isn't running.
the code the checking it is

    public String NameActivity() {

        ActivityManager am = (ActivityManager) context.getSystemService(context.ACTIVITY_SERVICE);
        List l = am.getRunningAppProcesses();
        Iterator i = l.iterator();
        PackageManager pm = this.context.getPackageManager();
        while (i.hasNext()) {
            ActivityManager.RunningAppProcessInfo info = (ActivityManager.RunningAppProcessInfo) (i.next());
            try {
                CharSequence c = pm.getApplicationLabel(pm.getApplicationInfo(info.processName, PackageManager.GET_META_DATA));
                Log.w("LABEL", c.toString());
            } catch (Exception e) {
                //Name Not FOund Exception
            }
        }
        return null;
    }

    public static boolean isThisProcessRunning(Context context, String processName) {
        if (processName == null) {
            return false;
        }
        ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
        List<RunningAppProcessInfo> processes = manager.getRunningAppProcesses();
        for (RunningAppProcessInfo process : processes) {
            if (processName.equals(process.processName)) {
                return true;
            }
        }
        return false;
    }
    }


hope you can help me.