2011-11-14 4 views
1

안드로이드에서 logcat의 활동 이름을 어떻게 읽을 수 있습니까? 일부 코드를 사용했지만 시작한 활동 이름을 얻지 못했습니다.안드로이드에서 로그 cat에서 활동 이름을 읽는 방법?

String baseCommand = "logcat -d time"; 
baseCommand += " ActivityManager:I "; // Info for my app 
baseCommand += " *:S "; // Silence others 
try 
{ 
    Process logReaderProcess = Runtime.getRuntime().exec(baseCommand); 
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(logReaderProcess.getInputStream())); 

    while ((line = bufferedReader.readLine()) != null) 
    { 
     Log.e("This is Camera open log",""+log); 
     log.append(line); // here readLine() returns null 
    } 
} 
catch (IOException e1) 
{ 
    e1.printStackTrace(); 
} 

누군가 해결책을 제안 할 수 있습니까?

답변

1

같은 명령을 그 you can extract activity name from the tag "Activity Manager" which last appeared.

에서 지금 ADB 로그 캣에서 활동 관리자 정보를 얻기를위한 작품
관련 문제