- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我可以获得关于我在 Eclipse 中制作的动态壁纸的帮助吗,我收到几个 logcat 错误。我已经研究了几个小时,不知道为什么我总是强制关闭。我在“动态壁纸选择屏幕”上强制关闭。当我运行该应用程序时,我什至无法查看任何动态壁纸。 int x,y;
public void onCreate()
{
super.onCreate();
}
public void onDestroy()
{
super.onDestroy();
}
public Engine onCreateEngine()
{
return new MyWallpaperEngine();
}
class MyWallpaperEngine extends Engine
{
private final Handler handler = new Handler();
private final Runnable drawRunner = new Runnable() {
@Override
public void run() {
draw();
}
};
private boolean visible = true;
public Bitmap image1,backgroundImage;
MyWallpaperEngine()
{
// get the fish and background image references
image1 = BitmapFactory.decodeResource(getResources(),R.drawable.fish);
backgroundImage = BitmapFactory.decodeResource(getResources(),R.drawable.water);
x=-130; // initialize x position
y=200; // initialize y position
}
public void onCreate(SurfaceHolder surfaceHolder)
{
super.onCreate(surfaceHolder);
}
@Override
public void onVisibilityChanged(boolean visible)
{
this.visible = visible;
if (visible)
{
handler.post(drawRunner);
}
else
{
handler.removeCallbacks(drawRunner);
}
}
@Override
public void onSurfaceDestroyed(SurfaceHolder holder)
{
super.onSurfaceDestroyed(holder);
this.visible = false;
handler.removeCallbacks(drawRunner);
}
public void onOffsetsChanged(float xOffset, float yOffset,
float xStep, float yStep, int xPixels, int yPixels)
{
draw();
}
void draw()
{
final SurfaceHolder holder = getSurfaceHolder();
Canvas c = null;
try
{
c = holder.lockCanvas();
// clear the canvas
c.drawColor(Color.BLACK);
if (c != null)
{
// draw the background image
c.drawBitmap(backgroundImage, 0, 0, null);
// draw the fish
c.drawBitmap(image1, x,y, null);
// get the width of canvas
int width=c.getWidth();
if(x>width+100)
{
// assign initial value to start with
x=-130;
}
// change the x position/value by 1 pixel
x=x+1;
}
}
finally
{
if (c != null)
holder.unlockCanvasAndPost(c);
}
handler.removeCallbacks(drawRunner);
if (visible)
{
handler.postDelayed(drawRunner, 10);
}
}
}
现在这是我的 Logcat
12-05 09:29:28.893: I/ActivityManager(794): START u0 {act=android.intent.action.SET_WALLPAPER cmp=com.google.android.googlequicksearchbox/com.google.android.launcher.GelWallpaperPickerActivity} from pid 1209
12-05 09:29:28.954: I/ActivityManager(794): Start proc com.google.android.googlequicksearchbox:wallpaper_chooser for activity com.google.android.googlequicksearchbox/com.google.android.launcher.GelWallpaperPickerActivity: pid=8101 uid=10022 gids={50022, 3003, 1028, 3002, 1015}
12-05 09:29:29.054: E/MP-Decision(1580): num online cores: 1 reqd : 3 available : 4 rq_depth:3.800000 hotplug_avg_load_dw: 60
12-05 09:29:29.054: E/MP-Decision(1580): UP cpu:1 core_idx:1 Nw:1.900000 Tw:140 total_time_up:143.000000
12-05 09:29:29.054: E/MP-Decision(1580): UP cpu:2 core_idx:2 Nw:2.700000 Tw:90 total_time_up:143.000000
12-05 09:29:29.404: E/MP-Decision(1580): num online cores: 3 reqd : 2 available : 4 rq_depth:1.700000 hotplug_avg_load_dw: 112
12-05 09:29:29.404: E/MP-Decision(1580): DOWN cpu:2 core_idx:2 Ns:2.100000 Ts:240 total_time_down:245.000000
12-05 09:29:29.504: E/MP-Decision(1580): num online cores: 2 reqd : 3 available : 4 rq_depth:5.700000 hotplug_avg_load_dw: 72
12-05 09:29:29.504: E/MP-Decision(1580): UP cpu:1 core_idx:1 Nw:1.900000 Tw:140 total_time_up:0.000000
12-05 09:29:29.504: E/MP-Decision(1580): UP cpu:2 core_idx:2 Nw:2.700000 Tw:90 total_time_up:92.000000
12-05 09:29:29.524: D/dalvikvm(24807): null clazz in OP_INSTANCE_OF, single-stepping
12-05 09:29:29.554: E/MP-Decision(1580): num online cores: 3 reqd : 4 available : 4 rq_depth:4.000000 hotplug_avg_load_dw: 140
12-05 09:29:29.554: E/MP-Decision(1580): UP cpu:1 core_idx:1 Nw:1.900000 Tw:140 total_time_up:0.000000
12-05 09:29:29.554: E/MP-Decision(1580): UP cpu:2 core_idx:2 Nw:2.700000 Tw:90 total_time_up:0.000000
12-05 09:29:29.554: E/MP-Decision(1580): UP cpu:3 core_idx:3 Nw:3.500000 Tw:90 total_time_up:138.000000
12-05 09:29:29.644: I/Adreno200-EGL(8101): <qeglDrvAPI_eglInitialize:265>: EGL 1.4 QUALCOMM Build: Iabe52cfaeae4c5fab1acacfe6f056ba15fa93274
12-05 09:29:29.744: D/OpenGLRenderer(8101): Enabling debug mode 0
12-05 09:29:29.804: E/MP-Decision(1580): num online cores: 4 reqd : 3 available : 4 rq_depth:2.000000 hotplug_avg_load_dw: 97
12-05 09:29:29.804: E/MP-Decision(1580): DOWN cpu:3 core_idx:3 Ns:3.100000 Ts:240 total_time_down:241.000000
12-05 09:29:30.065: I/ActivityManager(794): Displayed com.google.android.googlequicksearchbox/com.google.android.launcher.GelWallpaperPickerActivity: +1s118ms
12-05 09:29:30.155: E/MP-Decision(1580): num online cores: 3 reqd : 4 available : 4 rq_depth:3.800000 hotplug_avg_load_dw: 115
12-05 09:29:30.155: E/MP-Decision(1580): UP cpu:1 core_idx:1 Nw:1.900000 Tw:140 total_time_up:0.000000
12-05 09:29:30.155: E/MP-Decision(1580): UP cpu:2 core_idx:2 Nw:2.700000 Tw:90 total_time_up:0.000000
12-05 09:29:30.155: E/MP-Decision(1580): UP cpu:3 core_idx:3 Nw:3.500000 Tw:90 total_time_up:98.000000
12-05 09:29:30.355: I/dalvikvm-heap(8101): Forcing collection of SoftReferences for 1085506396-byte allocation
12-05 09:29:30.375: E/dalvikvm-heap(8101): Out of memory on a 1085506396-byte allocation.
12-05 09:29:30.375: I/dalvikvm(8101): "AsyncTask #1" prio=5 tid=13 RUNNABLE
12-05 09:29:30.375: I/dalvikvm(8101): | group="main" sCount=0 dsCount=0 obj=0x423ac980 self=0x75ed44b0
最佳答案
查看错误“1085506396 字节分配内存不足”。您收到此错误的原因可能是设备内存不足或者壁纸尺寸太大。
尝试减小动态壁纸的大小或尝试使用内存较大的设备(或模拟器)。
关于java - 动态壁纸强制接近场景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20403419/
我发现这个插件可以让youtube视频作为背景:http://formstone.it/components/wallpaper 看起来很简单,但行不通。我也没有收到任何错误。我在 codepen 上
我为 android 制作壁纸,我希望用户可以选择选项。显示带有选项的菜单,但有问题。当我单击任何选项并返回壁纸屏幕时,它们不会更新新选项。为什么?我的代码WallpaperService: publ
你好 friend ,whatsapp 中有一个选项,我们可以通过它更改 whatsapp 聊天的背景墙纸。我正在制作一个项目,其中我提供了很多壁纸,我想从我的壁纸列表中设置壁纸 我使用了这段代码,但
我在几个地方读到桌面墙纸可以设置为 HTML 文档。有没有人成功地以编程方式改变它? 下面的 VB6 代码片段帮助我为 BMP 设置东西,但是当我尝试将它用于 HTML 时,我得到一个漂亮的蓝色背景,
我正在尝试使用 clx 更改墙纸,但它不起作用。我的代码有什么问题? (ql:quickload :clx) (defpackage #:wm/uw (:use #:cl #:xlib)) (in
我正在尝试指定一个 jpg 文件作为特定桌面的壁纸,但它似乎不起作用...而是将背景更改为另一个图像不同的文件夹...有人知道如何修复它吗? tell application "System Even
我正在尝试指定一个 jpg 文件作为特定桌面的壁纸,但它似乎不起作用...而是将背景更改为另一个图像不同的文件夹...有人知道如何修复它吗? tell application "System Even
我正在尝试使用代码更改 Android 壁纸。我正在使用 WallpaperManager 类,但没有成功。我在/drawable 目录中使用了一个 .png 图像。我收到一条错误消息,指出“原始类型
我想知道 Android Live 3D 壁纸是如何创建的?使用什么软件?以及开发人员如何使它与触摸、滑动等交互...我希望有人能帮助我如何开始...谢谢 最佳答案 3d 壁纸是在 opengles
我想知道是否可以使用我的笔记本电脑从 ADB 更改 android 壁纸。我不知道是否存在任何命令,或者我是否需要将图片复制到文件夹或编辑文本文件。如果可能的话,我需要通过 ADB 解决这个问题。 谢
我在过去的几周里(认真地)在网上搜索过,但我找不到我需要的东西。我只想启动一个与 set as 操作相对应的 Intent 。它通常提供设置为墙纸 或设置为联系人图片。然后,如果设备上安装了更多应用程
我想更改 Windows 中的桌面墙纸(7,如果有影响的话)。 我下面的尝试没有成功。据我所知,它不会更改墙纸、注册表项或执行除打印“0”以外的任何操作。 require 'Win32API' SPI
目标是在没有控件的情况下在 UIView 中播放视频文件 (*.mp4)。 它将作为 ViewController 和其他控件的背景/墙纸,即 tableview、文本字段、图像将在视频播放时显示在
有没有办法在 C++ 中获取 Windows 墙纸(图标后面)的句柄以便在上面绘制?这将允许制作事件桌面(在 Windows XP 之后停产)等价物、Wallpaper Engine 等价物或任何其他
我希望使用 Windows API 在 C++ 中更改 Windows 桌面背景墙纸。 我已阅读以下有关此主题的帖子: How to change desktop background using V
我知道这个问题之前已经被问过,但是有谁知道是否可以以编程方式为最新的 iphone 操作系统iOS4.2(测试版)设置主屏幕(壁纸)的背景图像 。我知道这在以前是不可能的。 我发现您可以通过写入/va
我是一名优秀的程序员,十分优秀!