[android]通知バーに実行中として通知する
![]()
2009/09/11
- TAG
- android
NotificationManagerで通知領域に情報を出すことができますが、そのままですと
通知を消去で消せてしまい、実行中のactivityに遷移させようとしていた時などに
遷移できなくなってしまいます。
以下が通知するだけのコード。
mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notification = new Notification(R.drawable.icon, notiStr, System.currentTimeMillis());
contentIntent = PendingIntent.getActivity(this, 0, new Intent(this,raceMap.class),
Intent.FLAG_ACTIVITY_NEW_TASK);
notification.setLatestEventInfo(this, getString(R.string.app_name),getString(R.string.nm1), contentIntent);
mNM.notify(notificationId, notification);
ここに以下の1行を追加して、上段の実行中のアプリに登録することができます。
notification.flags= Notification.FLAG_ONGOING_EVENT;
トラックバック (0)
トラックバックURL: http://kiteretsu.kayac.com/cgi-bin/mt-tb.cgi/40
- android
- GravSynth
- IdeaPod
- tips
- UI
- activity
- air
- AIR本 Hello Air World
- andtroid
- Apple Store
- arduino
- AudioRecord
- bluetooth
- Funnel
- Gainer
- intent
- iphone
- ipod touch
- LED
- Lydian Chromatic Concept
- mapview
- mediarecorder
- Pen
- permission
- private trainer
- recoroid
- SD
- TelephonyManager
- TimePickerDialog
- YUREX
- アプリ
- ウェブで一発当てる方法
- ハッカソン
- マイク
- リリース
- ロクナナ
- ワークショップ
- 音楽
- 楽器
- 自己紹介
- 自己紹介
- 書籍
- 青山ブックセンター
- 閃考会議室
- 店舗
- 明和電機
- 録音


![_level0 [Flash Developers Blog]](/img/bnr_level0.gif)


コメントを投稿する