3
有沒有辦法顯示android狀態欄,當它隱藏的服務?通過顯示,我的意思是隻在屏幕頂部的酒吧,而不是擴大通知區域。如何以編程方式顯示Android狀態欄?
Play Store中的智能狀態欄以某種方式在沒有根的情況下執行此操作。
另外,我也試圖用下面的代碼擴展狀態欄通知:
Object service = mContext.getSystemService("statusbar");
Class<?> statusbarManager = Class.forName("android.app.StatusBarManager");
Method expand = statusbarManager.getMethod("expand");
expand.invoke(service);
具有所需權限。但似乎沒有發生。
任何幫助,將不勝感激!
你在mContext中存儲哪些上下文?在這裏更好地使用'getApplicationContext()'; –