- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 v13 支持库。我使用通知生成器和 .setProgress 构建进度通知。它在 4.2.2 设备上运行良好,但在 2.3.5 上什么也没有显示。
这是正常行为吗?
mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mBuilder = new NotificationCompat.Builder(this);
mBuilder.setContentTitle("Photo Upload")
.setContentText("Upload in progress")
.setSmallIcon(R.drawable.ic_action_upload)
.setOngoing(true);
.
.
mBuilder.setProgress(100, prog, false);
mNotifyManager.notify(sNotificationID, mBuilder.build());
最佳答案
似乎不支持 Gingerbread(及以下版本),也没有记录。
这是来自支持库的实际代码,它创建了一个 Notification
的实例。 :
static class NotificationCompatImplBase implements NotificationCompatImpl {
public Notification build(Builder b) {
Notification result = (Notification) b.mNotification;
result.setLatestEventInfo(b.mContext, b.mContentTitle,
b.mContentText, b.mContentIntent);
// translate high priority requests into legacy flag
if (b.mPriority > PRIORITY_DEFAULT) {
result.flags |= FLAG_HIGH_PRIORITY;
}
return result;
}
}
唯一可行的选择是使用自定义 RemoteView
.您可能想查看 Android 源代码以获取示例进度通知布局。
关于android - NotificationBuilder.setProgress 在 2.3.5 上不执行任何操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16282965/
我似乎有与大多数人相反的问题。我在我的 UIProgressView(它被添加到我的单元格 View )上调用 setProgress。我没有动画调用它,但变化似乎是动画的,我似乎无法将其关闭。 我看
我有一个使用 Lottie 的动画效果很好,问题是,假设我的动画是一个会增大和缩小的球(就像它在跳动一样),当用户按下球时,我需要它“增长到”处于其最大尺寸”,因此我需要将动画进度设置为 1(对吗?)
所以,我的应用程序因“java.lang.NumberFormatException: Invalid int: "2160000000”而崩溃,据我所知,最大可能的整数是 2,147,483,647
您好,我想知道如何在扩展 Preference 的类中使用以下方法 findViewById(int id) ,该类定义了一个名为 setProgress(int) 的方法Progress) ,它使用
由于某种原因,UIProgressView.setProgress(1, animate: true) 导致出现困惑的动画。下图显示了问题所在。首先,它从中心向外动画,并且从略高于其实际位置的位置开始
我正在尝试在 fragment 中设置进度条的值,但应用程序崩溃并出现此错误: Attempt to invoke virtual method 'void android.widget.Progre
我试图在进度条中显示信号强度级别,但我在行中遇到异常:progressBar.setProgress(10);可能是什么原因? public class MonAdaptateurDeListe ex
我的主要进度和次要进度同时增长,次要进度比主要进度增长得更快。每次我更新主要进度时,次要进度都会丢失(就像它为零或小于主要进度一样)。这会产生令人讨厌的闪烁。 我发现的唯一解决方法是在设置主要后将次要
Seek 没有进行。所有搜索栏都归零,但 textView 正确显示值.. choosePreset.setOnClickListener(new OnClickListener() { @O
我正在使用 android seekBar 作为相机变焦 Controller 。 搜索栏在拖动时就像一个魅力,但我想添加一个放大和缩小按钮来增加进度。问题是双重的。 当我点击按钮时,我必须点击它 4
我是 Android 菜鸟,正在尽我所能去理解它。我正在尝试制作一个 apk 只是为了好玩,以便更好地理解事物,而且还有一个问题,即使在搜索谷歌之后我还没有解决。所以,问题是我有一个只允许数字的 Ed
我设置了一个循环进度条(从 0 到 100)来显示时间运行进度(从 1:00 到 0:00)。时间为1:00时,进度必须为0,时间为0:00时,进度必须为100。 这是进度条背景:
我正在尝试设置进度条的进度,但它一直在旋转,我是否需要添加一些东西或如何将其设置为某个百分比? 代码: public class TabOverviewFragment extends Fragmen
我以前见过这个问题,但我找不到有效的答案,而且我几天来一直在研究同样的问题闷闷不乐。 我有一个带有 3 个进度条的屏幕,我想在漫长的下载过程中更新它。无论我尝试什么,我都无法更新进度条。 完整来源是h
我对 SwingWorker 进行了快速而粗略的实现,以测试 publish() 和 setProgress() 方法。当我按照下面完整源代码中的说明为 setProgress() 方法设置参数时,一
我在 viewpager 页面 0 中有一个进度条。这是进度条: 现在当该页面加载时,我将进度条设置为 0,我得到如下所示的完美屏幕: 这是我使用的代码: mainActivity.sout("p
我读过许多关于 JProgressBar 的不同文章...包括在 Java 中发现的狡猾代码; here. 大多数人表示您需要一个 SwingWorker 来让事情正常进行,这是完全有道理的,我明白这
这是我在堆栈上的第一个问题(很棒的社区,谢谢!) 所以,我有这个问题: 我正在开发一个带有选项卡布局的 Android 应用程序。每当我导航到“状态”选项卡时,我都想显示一个根据变量值更新的圆形进度条
我正在尝试使用 SeekBar 来显示 MediaPlayer 类播放的轨道的长度,并在轨道中启用搜索。 在轨道内寻找效果很好。但是,在播放轨道时使用 setProgress 更新进度值似乎会导致轻微
我想在 10 秒内为我的 UIProgressView 进度设置动画,从 0 到 1。 代码: [UIView animateWithDuration:10.0 animations:^{ [
我是一名优秀的程序员,十分优秀!