public void CheckTop(String packagename,int casenum)
    {
        Context context = getBaseContext();
        ActivityManager am = (ActivityManager) context.
                getSystemService(Activity.ACTIVITY_SERVICE);

        String className = am.getRunningTasks(1).get(0).topActivity.getClassName();
        if(!className.contains(packagename) )
        {
            lo
            Log.d("TAG", " Test fail...");
        }
        else
        {
            Log.d("TAG", " Test pass...");
        }
    }

  

posted on 2016-01-08 16:38  小白闯天下  阅读(515)  评论(0编辑  收藏  举报