On progressUpdate, I am updating the notification..
My progress code is below:
protected void onProgressUpdate(Long... values) {
if(_percentUploaded>=0 && _percentUploaded < 100){
updateNotification(notification_id, 100, _percentUploaded,
_total, _uploadedSize);
}else if(_percentUploaded == 100){
updateNotification(notification_id, filename, 0);
}
}
public static void updateNotification(Notification notification, int id, int
maxSizePercent,
int updatedPercent, long totalSize, long uploadedSize){
NotificationManager mNotificationManager = (NotificationManager)
act.getSystemService(Context.NOTIFICATION_SERVICE);
notification.contentView.setProgressBar(R.id.notify_progressbar,
maxSizePercent, updatedPercent, false);
String text = "[ " + Utils.getFileSize(uploadedSize) + " / " +
Utils.getFileSize(totalSize) + " ]";
notification.contentView.setTextViewText(R.id.notify_uploaded_size,
text);
mNotificationManager.notify(id, notification);
}
On Tue, Apr 26, 2011 at 6:27 PM, TreKing <[email protected]> wrote:
> On Tue, Apr 26, 2011 at 4:57 PM, faah <[email protected]> wrote:
>
>> Is there a reason WHY the app stops responding. This started
>> happening after I added the progress bar.
>>
>
> You didn't add much detail, but I would guess your AsyncTask is set up
> wrong where you're actually doing the intensive task in the reportProgress
> part.
> Hard to say more without seeing the codes.
>
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
*Farah Hanif*
613-851-9128
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en