从logcat中发送一个广播 [英] send a broadcast from logcat
问题描述
如何我送从logcat的结果像广播广播方式发送,如果活动启动(它与功能标签活动管理器)
how can i send broadcast from logcat result like send broadcast if activity start (it taged with activity manager)
一样,如果浏览器启动的logcat将显示:
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
LogCatNotifier
的https://play.google.com/store/apps/details?id=RabiSoft.LogCatNotifier&hl=en
推荐答案
如果你要问是怎么当的具体东西记录你知道什么时候发送一个广播,你应该有一个服务
监控设备的日志,并在遇到您要发送约广播日志,那么你应该发送广播。
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
编辑:如果我没有记错,在软糖它不再能够读取任何应用程序日志,除了你自己。
If I'm not mistaken, in JellyBean it's no longer possible to read logs from any app besides your own.
这篇关于从logcat中发送一个广播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!