/** * Use with {@link #getSystemService} to retrieve a {@link * android.app.StatusBarManager} for interacting with the status bar. * * @see #getSystemService * @see android.app.StatusBarManager * @hide */ public static final String STATUS_BAR_SERVICE = "statusbar";这个是隐藏的,所以是没办法直接调用的,只能使用"statusbar"字符串来引用。 如果需要使用STATUS_BAR_SERVICE , 那得把build path下面的Android lib删除,然后使用自己编译源码生成的jar来替换,这样比较麻烦,但是系统隐藏的很多类,方法都可以调用了。
你可以直接把解决方案告诉我吗? 如果我理解没错: 添加一个全局变量: public static final String STATUS_BAR_SERVICE = "statusbar"; 然后 : ServiceManager.getService(STATUS_BAR_SERVICE) 是这样吗 。 Context 要去掉吗 ? 谢谢
* Use with {@link #getSystemService} to retrieve a {@link
* android.app.StatusBarManager} for interacting with the status bar.
*
* @see #getSystemService
* @see android.app.StatusBarManager
* @hide
*/
public static final String STATUS_BAR_SERVICE = "statusbar";这个是隐藏的,所以是没办法直接调用的,只能使用"statusbar"字符串来引用。
如果需要使用STATUS_BAR_SERVICE , 那得把build path下面的Android lib删除,然后使用自己编译源码生成的jar来替换,这样比较麻烦,但是系统隐藏的很多类,方法都可以调用了。
如果我理解没错:
添加一个全局变量: public static final String STATUS_BAR_SERVICE = "statusbar";
然后 : ServiceManager.getService(STATUS_BAR_SERVICE) 是这样吗 。 Context 要去掉吗 ? 谢谢
谢谢二位。