问题
how can i send broadcast from logcat result like send broadcast if activity start (it taged with activity manager)
like if browser start the logcat will display that :
09-10 09:47:04.020: I/ActivityManager(2707): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.browser/.BrowserActivity } from pid 2880
there are app in market do like what is ask for which called
LogCatNotifier
https://play.google.com/store/apps/details?id=RabiSoft.LogCatNotifier&hl=en
回答1:
If what you're asking is how do you know when to send a broadcast when something specific is logged, you should have a Service
monitor the device's logs, and when it encounters a log that you want to send a broadcast about, then you should send a broadcast.
You can learn about reading from logs programmatically here
EDIT: If I'm not mistaken, in JellyBean it's no longer possible to read logs from any app besides your own.
来源:https://stackoverflow.com/questions/12346866/send-a-broadcast-from-logcat