ピクトエリアへのアイコンの描画について

378 views
Skip to first unread message

ロイド

unread,
Jun 25, 2009, 10:13:57 PM6/25/09
to 日本Androidの会
みなさん、こんにちは。
ロイドです。

どなたかご存知でしたら、教えていただきたいのですが
アプリのピクトエリア(電池残量や、電波状態のアイコンが表示されているエリア)に
自分が作ったアプリが起動している時にアイコンを表示したいと考えているのですが
ピクトエリアにアイコンを表示することは可能なのでしょうか?

Keiji Ariyama

unread,
Jun 25, 2009, 11:02:29 PM6/25/09
to android-g...@googlegroups.com
有山@大阪です。日本androidの会総会のため東京におりま
す。

SystemServiceのNotificationManagerを使って表示します。

Keiji
from my iPhone

ロイド

unread,
Jun 26, 2009, 5:25:10 AM6/26/09
to 日本Androidの会
有山さん
お世話になります。ロイドです。

Notificationを使用する事も考えたのですが
ユーザーにクリアされる事が懸念される為
電波や電池残量のアイコンのように表示させれないかと考えております。


On 6月26日, 午後12:02, Keiji Ariyama <keiji_ariy...@c-lis.co.jp> wrote:
> 有山@大阪です。日本androidの会総会のため東京におりま
> す。
>
> SystemServiceのNotificationManagerを使って表示します。
>
> Keiji
> from my iPhone
>
> On 2009/06/26, at 11:13, ロイド <androidr...@gmail.com> wrote:
>
>
>
>
>
> > みなさん、こんにちは。
> > ロイドです。
>
> > どなたかご存知でしたら、教えていただきたいのですが
> > アプリのピクトエリア(電池残量や、電波状態のアイコンが表示
> > されているエリア)に
> > 自分が作ったアプリが起動している時にアイコンを表示したいと考えて
> > いるのですが
> > ピクトエリアにアイコンを表示することは可能なのでしょうか?- 引用テキストを表示しない -
>
> - 引用テキストを表示 -

yokatoro

unread,
Jun 26, 2009, 11:22:35 AM6/26/09
to 日本Androidの会
ロイドさん、有山さん
yokatoと申します。こんにちは。

Creating Status Bar Notifications | Android Developers
[http://developer.android.com/guide/topics/ui/notifiers/
notifications.html]
を見ると、
"FLAG_ONGOING_EVENT" flag
Add this to the flags field to group the notification under the
"Ongoing" title in the Notifications window. This indicates that the
application is on-going ― its processes is still running in the
background, even when the application is not visible (such as with
music or a phone call).
"FLAG_NO_CLEAR" flag
Add this to the flags field to indicate that the notification
should not be cleared by the "Clear notifications" button. This is
particularly useful if your notification is on-going.

というフラグがあります。これで用は足りませんか?
(アイコンの表示場所はステータスバーの左側ですが…)

Ongoingの例としては、Musicアプリの再生中を示すアイコンがわかりやすいです。

Keiji Ariyama

unread,
Jun 27, 2009, 5:32:17 AM6/27/09
to android-g...@googlegroups.com
yokatoさん。
 アドバイスありがとうございます。有山@大阪です。

http://developer.android.com/guide/topics/ui/notifiers/notifications.html

> "FLAG_NO_CLEAR" flag

 そうですね。FLAG_NO_CLEARをつければ、ユーザーが任意に消すことは出来な
くなりますから、ロイドさんのやりたいことを実現できるんじゃないかと思います。
 あ、アプリ終了時にちゃんとクリアしてやるのを忘れずに。

/*********************************************
有限会社シーリス
代表 有山 圭二
@Address
〒530-0044
大阪市北区東天満二丁目2番5号
第2新興ビル 601
@Web http://www.c-lis.co.jp
*********************************************/
Reply all
Reply to author
Forward
0 new messages