これを起動するのにちょいと手間がかかる。かかるといってもたいしたことはないけど。
まず、AndroidManifest.xmlに下記パーミッションを追加。
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
あとはこんな感じのソースを書いて呼べばOK。
private void showNotifications() {
try {
Object service = getSystemService("statusbar");
if (service != null) {
Method expand = service.getClass().getMethod("expand");
expand.invoke(service);
}
} catch (Exception e) {
}
}
ちなみにHideなAPI使ってるのでいきなり使えなくなるかも?

0 件のコメント:
コメントを投稿