Android:如何使用进度条创建持续通知?

Android:如何使用进度条创建持续通知?,android,notifications,Android,Notifications,我正在使用一项服务来播放背景音乐,我想在状态栏上创建一个带有进度条的持续通知,以便用户可以观看当前曲目的进度。有人能帮我吗?非常感谢…创建一个,并将类似内容放入通知\u layout.xml文件中: <ProgressBar android:layout_width="fill_parent" android:layout_height="15dp" android:id="@+id/notificationLoadingBar" android:prog

我正在使用一项服务来播放背景音乐,我想在状态栏上创建一个带有进度条的持续通知,以便用户可以观看当前曲目的进度。有人能帮我吗?非常感谢…

创建一个,并将类似内容放入通知\u layout.xml文件中:

<ProgressBar 
    android:layout_width="fill_parent"
    android:layout_height="15dp"
    android:id="@+id/notificationLoadingBar"
    android:progressDrawable="@android:drawable/progress_horizontal"
    android:indeterminate="false" 
    android:indeterminateOnly="false" />

非常感谢,它对我很有用,现在我想在我的服务类中创建一个线程来更新我的进度条。你知道我如何在服务类中创建线程吗?谢谢…@Tim:Use
mNotification.contentView.setProgressBar(R.id.notificationLoadingBar,
    max, progress, false);