2011-09-16 22 views

答えて

73

が、これはU

private boolean isMyServiceRunning() { 
    ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); 
    for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { 
     if ("com.example.MyService".equals(service.service.getClassName())) { 
      return true; 
     } 
    } 
    return false; 
} 
+0

のために有用である可能性が試してみてくださいこれは、私が必要なもののおかげです! – Maurice

+0

実行中の場合にサービスを停止する方法... – Kishore

+1

@Kishoreこの同じトピックはここhttp://stackoverflow.com/questions/2176375/android-service-wont-stop –

関連する問題