diff options
author | Katie McCormick <kmccormick@google.com> | 2014-04-04 21:35:50 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-04 21:35:50 +0000 |
commit | de4fedefbf4772e15bb9aa95458fd2f314cdb502 (patch) | |
tree | 72e052424d835956f6e9b4dc2c0a25644d3ec76c /docs | |
parent | 642421aa7f284817cc1a972a7f9c7a64696a0116 (diff) | |
parent | 8e63696a73dfebae9b2ec123611db6b21968dbfd (diff) | |
download | frameworks_base-de4fedefbf4772e15bb9aa95458fd2f314cdb502.zip frameworks_base-de4fedefbf4772e15bb9aa95458fd2f314cdb502.tar.gz frameworks_base-de4fedefbf4772e15bb9aa95458fd2f314cdb502.tar.bz2 |
am 8e63696a: am f7bffe77: am fc8ea92d: Merge "Doc Update: notification bug fix." into klp-docs
* commit '8e63696a73dfebae9b2ec123611db6b21968dbfd':
Doc Update: notification bug fix.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/html/training/notify-user/display-progress.jd | 9 | ||||
-rw-r--r-- | docs/html/training/notify-user/navigation.jd | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/docs/html/training/notify-user/display-progress.jd b/docs/html/training/notify-user/display-progress.jd index 2b2b3ae..c00576c 100644 --- a/docs/html/training/notify-user/display-progress.jd +++ b/docs/html/training/notify-user/display-progress.jd @@ -80,6 +80,7 @@ previous.link=expanded.html setProgress(0, 0, false)}. For example: </p> <pre> +int id = 1; ... mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); @@ -100,7 +101,7 @@ new Thread( // state mBuilder.setProgress(100, incr, false); // Displays the progress bar for the first time. - mNotifyManager.notify(0, mBuilder.build()); + mNotifyManager.notify(id, mBuilder.build()); // Sleeps the thread, simulating an operation // that takes time try { @@ -114,7 +115,7 @@ new Thread( mBuilder.setContentText("Download complete") // Removes the progress bar .setProgress(0,0,false); - mNotifyManager.notify(ID, mBuilder.build()); + mNotifyManager.notify(id, mBuilder.build()); } } // Starts the thread by calling the run() method in its Runnable @@ -157,7 +158,7 @@ new Thread( // percentage, and "determinate" state mBuilder.setProgress(100, incr, false); // Issues the notification -mNotifyManager.notify(0, mBuilder.build()); +mNotifyManager.notify(id, mBuilder.build()); </pre> <p> Replace the lines you've found with the following lines. Notice that the third parameter @@ -169,7 +170,7 @@ mNotifyManager.notify(0, mBuilder.build()); // Sets an activity indicator for an operation of indeterminate length mBuilder.setProgress(0, 0, true); // Issues the notification -mNotifyManager.notify(0, mBuilder.build()); +mNotifyManager.notify(id, mBuilder.build()); </pre> <p> The resulting indicator is shown in figure 2: diff --git a/docs/html/training/notify-user/navigation.jd b/docs/html/training/notify-user/navigation.jd index ac4689a..fc95013 100644 --- a/docs/html/training/notify-user/navigation.jd +++ b/docs/html/training/notify-user/navigation.jd @@ -95,6 +95,7 @@ next.link=managing.html {@link android.app.Activity}. For example: </p> <pre> +int id = 1; ... Intent resultIntent = new Intent(this, ResultActivity.class); TaskStackBuilder stackBuilder = TaskStackBuilder.create(this); |