更新时间:2023-11-19 12:30:22
在任何地方使用该code。
Use this code anywhere.
Object sbservice = getSystemService( "statusbar" );
Class<?> statusbarManager = Class.forName( "android.app.StatusBarManager" );
Method showsb = statusbarManager.getMethod( "expand" );
showsb.invoke( sbservice );
还是要使它更短的使用这样的:
Or to make it more short use this :
StatusBarManager statusBar = (StatusBarManager) getSystemService(STATUS_BAR_SERVICE);
statusBar.expand();
权限是必需的清单中。
Permission is required in manifest.
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />