try {
Object service = getSystemService ("statusbar");
Class <?> statusBarManager = Class.forName
("android.app.StatusBarManager");
Method expand = statusBarManager.getMethod ("expand");
expand.invoke (service);
} catch (Exception e) {
Toast.makeText(getApplicationContext(), e.getMessage(),
Toast.LENGTH_LONG).show();
}
这里要加上权限:
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" / >
打开通知栏
最新推荐文章于 2024-01-10 14:33:14 发布