The method getSystemService(String) is undefined for the type Listen
<p>I'm trying to check if com.android.music is running and I'm getting the following error on this line <code>this.getSystemService(Context.ACTIVITY_SERVICE);</code></p>

<p>error:</p>

<pre><code>The method getSystemService(String) is undefined for the type Listen
</code></pre>

<p>Code:    </p>

<pre><code>public boolean isMusicRunning() {

            ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
            List&lt;RunningAppProcessInfo&gt; procInfos = activityManager.getRunningAppProcesses();
            for (int i = 0; i &lt; procInfos.size(); i++) {
                if (procInfos.get(i).processName.equals("com.android.music")) {
                    Toast.makeText(null, "music is running",
                            Toast.LENGTH_LONG).show();
                }
            }
        } 
</code></pre>

<p>If you could let me know what I'm doing wrong here that would be great!</p>

<p>thanks</p>
