![](/img/trans.png)
[英]How to check whether a activity is foreground and bring it to background when it is foreground?
[英]android how to bring singleInstance activity to foreground when lockscreen is active
我的應用程序使用BroadcastReceiver監視充電器連接。 連接充電器后,應用程序啟動。 主要活動定義為singleInstance。 在BroadcastReceiver中,我正在使用
it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
一切正常,但是當鎖屏處於活動狀態時,活動為“凍結”,並且不會調用onCreate和onStart。
如何解決? 謝謝,Eyal。
通過使用onNewIntent()實現解決。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.