如何创建右侧一个通知\状态栏图标? [英] How to create a Notification \ status bar icon on the right side?
问题描述
好吧,我看到很多人只是驳回了这一问题,他说
Ok I saw a lot of people just dismiss this question by saying
这是留给OS组件
它要求访问源
嗯,我有机会获得源代码,我可以将任何应用程序或插件我想作为一个系统应用程序。所以,现在我将如何去让我的小部件显示其通知右边?
Well I have access to the source and I can set any app or widget I want as a system app. So now how would I go about making my widget show its notification on the right side?
编辑: OK脂肪酶会在错误的方向,使病人增加上下文来这里。 。 。 看UR电话。 。 。你看到的Wi-Fi信号和电话信号在手机右侧的所有的时间正确的。我想成为藏汉显示有我的信号。 。 。随着系统的信号。 。我在我的公司正在平板电脑一个新的硬件芯片,我必须不断显示其信号强度,就像手机信号。它是将被集成到片剂的Android的源
ok ppl are going in the wrong direction so ill add come context here . . . look at ur phone . . . u see Wi-Fi signal and phone signal on the right side of the phone all the time right. I want my signal to be shown there aswell . . . along with the system signals . . I have a new hardware chip in the tablet my company is making and I have to display its signal strength constantly just like the phone signal. It is going to be integrated into the Android source of the tablet.
推荐答案
您可能需要参考的Android的源$ C $的手机状态栏c中的code,在<一个href="https://android.googlesource.com/platform/frameworks/base/+/android-4.3_r3.1/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java">https://android.googlesource.com/platform/frameworks/base/+/android-4.3_r3.1/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
You might need to refer to the code of Android source code of phone status bar, at https://android.googlesource.com/platform/frameworks/base/+/android-4.3_r3.1/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
和看一看的方法,如
addIcon
updateIcon
removeIcon
这是不容易的事,因为你必须自己增加很多的东西。
It is not easy task since you have to add lots of stuff by yourself.
这篇关于如何创建右侧一个通知\状态栏图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!