- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在编写一个 android 应用程序,它需要在千分之几秒内显示一些文本,然后再次将其显示为空白。我现在所拥有的是它显示文本,然后使用 Thread.sleep,然后将文本设置回 null。相反,当我按下按钮时,应用程序会挂起设定的时间,文本永远不会出现,并且 logcat 显示“跳过 xxx 帧!应用程序可能在其主线程上做了太多工作。”这是怎么回事,是否有更好的处理方法?
最佳答案
尝试使用可运行的。
private Handler mHandler = new Handler();
//code to make text appear...
mHandler.postDelayed(makeTextDisapear , 3000); // Replace 3000 with the number of milliseconds you want the text to display.
private Runnable makeTextDisapear = new Runnable() {
public void run() {
// code to make text dissapear
}
};
关于java - 为什么我的 android 应用程序在调用 Thread.sleep 时跳帧?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13004096/
我正在尝试使用 nx 在图中找到一些特定节点(比方说 l 节点)的 1 跳、2 跳,如果需要,k 跳邻居。 single_source_dijkstra_path_length. 每个步骤的时间复杂度
假设在下一段中我的光标位于第一句中的第一个are上(希望我可以突出显示它,但我不能这样...... )。按两次 ff 后,第一句话就会傻瓜,然后of 。再按下去我将一事无成。 Some people
给定一个无向图,一个起始顶点和一个结束顶点。求出从源到汇的步行次数(这样一个顶点可以被多次访问)正好涉及 h 跳。例如,如果图形是三角形,则具有 h 跳的此类路径的数量由第 h 个 Jakobstah
我正在制作 Winston Wolf 的交互式 map 。我有一张世界地图,每个大陆都可以点击并显示该大陆的国家。当我点击非洲大陆时,页面会跳转到非洲国家(如您所料)。我的问题是,我可以阻止它跳跃吗?
这是我的第一个问题,所以如果我问错了,我很抱歉。 在我的实验中,多个 android 设备使用 WiFi Direct 连接。为了利用无线 tx 的广播特性,所有设备都加入一个多播组来交换它们的信息。
我最近开发了一个 WCF Facade 服务。我是 WCF 的新手,无法理解安全实现部分。 服务如下: 一个 asp.net 公共(public)网站有一个 WCF 客户端,它访问: DMZ 中的 W
序言: 当问楼梯问题时,通常给定的允许步幅数组是 [1,2,3] 在 SO 上看到很多相同问题的例子,比如 n-steps-with-1-2-or-3-steps-taken-how-many-way
我是一名优秀的程序员,十分优秀!