Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java android livewallpaper设置按钮点击导致错误-不幸的是,livewallpaper选择器已停止_Java_Android_Crash_Libgdx_Live Wallpaper - Fatal编程技术网

Java android livewallpaper设置按钮点击导致错误-不幸的是,livewallpaper选择器已停止

Java android livewallpaper设置按钮点击导致错误-不幸的是,livewallpaper选择器已停止,java,android,crash,libgdx,live-wallpaper,Java,Android,Crash,Libgdx,Live Wallpaper,我正试图用libgdx库在android上制作一个实时壁纸应用程序,但我遇到了一个问题。每当在live wallpaper picker中按下设置按钮时,应用程序就会崩溃并显示消息:“很遗憾,live wallpaper picker已停止”,否则一切正常 我一直在遵循这个例子: 我试着在这里寻找解决方案,例如本页: 但是没有任何东西可以解决我的问题——我想它在xml文件中的某个地方,但是也许在将libgdx与livewallpaper结合起来时会出现问题 我一直在试图找到一个解决办法,但不

我正试图用libgdx库在android上制作一个实时壁纸应用程序,但我遇到了一个问题。每当在live wallpaper picker中按下设置按钮时,应用程序就会崩溃并显示消息:“很遗憾,live wallpaper picker已停止”,否则一切正常

我一直在遵循这个例子:

我试着在这里寻找解决方案,例如本页:

但是没有任何东西可以解决我的问题——我想它在xml文件中的某个地方,但是也许在将libgdx与livewallpaper结合起来时会出现问题

我一直在试图找到一个解决办法,但不能,真的很感谢一些帮助

这是我的密码:

Manifest.xml

<?xml version="1.0" encoding="UTF-8"?>
<wallpaper
       xmlns:android="http://schemas.android.com/apk/res/android"  
       android:thumbnail="@drawable/ic_launcher"
       android:settingsActivity="lwp.example.android.LivewallpaperSettings"/>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    android:title="settings"
    android:key="settings">

    <ListPreference
        android:key="livewallpaper_testpattern"
        android:title="title 1"
        android:summary="do 1"
        android:entries="@array/livewallpaper_testpattern_names"
        android:entryValues="@array/livewallpaper_testpattern_prefix"/>
    <CheckBoxPreference android:key="livewallpaper_movement"
        android:title="title 2"
        android:summary="do 2"
        android:summaryOn="Moving test pattern"
        android:summaryOff="Still test pattern"/>
</PreferenceScreen>

livewallpersettings.java

package com.mygdx.game.android;
导入android.content.SharedReferences;
导入android.os.Bundle;
导入android.preference.PreferenceActivity;
公共类LiveWallperSettings扩展首选项活动实现SharedReferences.OnSharedPreferenceChangeListener{
@凌驾
创建时受保护的空隙(捆绑冰柱)
{
超级冰柱;
getPreferenceManager().setSharedPreferencesName(LiveWallpaper.SHARED_PREFS_NAME);
addPreferencesFromResource(R.xml.settings);
getPreferenceManager().GetSharedReferences()
.RegisterOnSharedReferenceChangeListener(此);
}
@凌驾
受保护的void onResume()
{
super.onResume();
}
@凌驾
受保护的空onDestroy()
{
getPreferenceManager().GetSharedReferences()
.UnregisterSharedPreferenceChangeListener(此);
super.ondestory();
}
已更改共享首选项的公共无效(SharedReferences SharedReferences,
字符串键)
{
}
}
wallpaper.xml

<?xml version="1.0" encoding="UTF-8"?>
<wallpaper
       xmlns:android="http://schemas.android.com/apk/res/android"  
       android:thumbnail="@drawable/ic_launcher"
       android:settingsActivity="lwp.example.android.LivewallpaperSettings"/>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    android:title="settings"
    android:key="settings">

    <ListPreference
        android:key="livewallpaper_testpattern"
        android:title="title 1"
        android:summary="do 1"
        android:entries="@array/livewallpaper_testpattern_names"
        android:entryValues="@array/livewallpaper_testpattern_prefix"/>
    <CheckBoxPreference android:key="livewallpaper_movement"
        android:title="title 2"
        android:summary="do 2"
        android:summaryOn="Moving test pattern"
        android:summaryOff="Still test pattern"/>
</PreferenceScreen>

settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<wallpaper
       xmlns:android="http://schemas.android.com/apk/res/android"  
       android:thumbnail="@drawable/ic_launcher"
       android:settingsActivity="lwp.example.android.LivewallpaperSettings"/>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    android:title="settings"
    android:key="settings">

    <ListPreference
        android:key="livewallpaper_testpattern"
        android:title="title 1"
        android:summary="do 1"
        android:entries="@array/livewallpaper_testpattern_names"
        android:entryValues="@array/livewallpaper_testpattern_prefix"/>
    <CheckBoxPreference android:key="livewallpaper_movement"
        android:title="title 2"
        android:summary="do 2"
        android:summaryOn="Moving test pattern"
        android:summaryOff="Still test pattern"/>
</PreferenceScreen>

这是我得到错误时的日志:

11-14 15:40:04.254: W/GL2JNIView(1654): creating OpenGL ES 2.0 context
11-14 15:40:04.265: I/AndroidGraphics(1654): OGL renderer: Adreno (TM) 320
11-14 15:40:04.265: I/AndroidGraphics(1654): OGL vendor: Qualcomm
11-14 15:40:04.265: I/AndroidGraphics(1654): OGL version: OpenGL ES 3.0 V@84.0 AU@05.00.02.006.020 (CL@)
11-14 15:40:04.265: I/AndroidGraphics(1654): OGL extensions: GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_robustness GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_sync GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_depth_texture_cube_map GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_OES_vertex_array_object GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_EXT_multisampled_render_to_texture GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_disjoint_timer_query 
11-14 15:40:04.265: W/Adreno-EGL(1654): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
11-14 15:40:04.265: W/Adreno-EGL(1654): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
11-14 15:40:04.265: I/AndroidGraphics(1654): framebuffer: (5, 6, 5, 0)
11-14 15:40:04.265: I/AndroidGraphics(1654): depthbuffer: (16)
11-14 15:40:04.265: I/AndroidGraphics(1654): stencilbuffer: (0)
11-14 15:40:04.265: I/AndroidGraphics(1654): samples: (0)
11-14 15:40:04.265: I/AndroidGraphics(1654): coverage sampling: (false)
11-14 15:40:04.333: I/Running LiquidFun version(1654): LiquidFun 1.1.0
11-14 15:40:04.333: I/720.0(1654): 1280.0
11-14 15:40:04.429: I/AndroidInput(1654): sensor listener setup
11-14 15:40:09.043: I/WallpaperService(1654): service destroyed
11-14 15:40:09.043: I/WallpaperService(1654): engine paused
11-14 15:40:09.217: E/Surface(1654): queueBuffer: error queuing buffer to SurfaceTexture, -19
11-14 15:40:09.218: W/Adreno-EGLSUB(1654): <SwapBuffers:1344>: failed to queueBuffer
11-14 15:40:09.218: W/Adreno-EGL(1654): <qeglDrvAPI_eglSwapBuffers:3798>: EGL_BAD_SURFACE
11-14 15:40:09.220: I/AndroidInput(1654): sensor listener tear down
11-14 15:40:09.236: E/Surface(1654): queueBuffer: error queuing buffer to SurfaceTexture, -19
11-14 15:40:09.236: W/Adreno-EGLSUB(1654): <SwapBuffers:1344>: failed to queueBuffer
11-14 15:40:09.236: W/Adreno-EGL(1654): <qeglDrvAPI_eglSwapBuffers:3798>: EGL_BAD_SURFACE
11-14 15:40:09.244: I/WallpaperService(1654): engine surface destroyed
11-14 15:40:04.254:W/GL2JNIView(1654):创建OpenGL ES 2.0上下文
11-14 15:40:04.265:I/AndroidGraphics(1654):OGL渲染器:Adreno(TM)320
11-14 15:40:04.265:I/AndroidGraphics(1654):OGL供应商:高通公司
11-14 15:40:04.265:I/AndroidGraphics(1654):OGL版本:OpenGL ES 3.0V@84.0 AU@05.00.02.006.020(CL@)
11-14 15:40:04.265:I/AndroidGraphics(1654):OGL扩展:GL_AMD_compressed_ATC_texture GL_AMD_program_binary_Z400 GL_EXT_debug_标签GL_EXT_debug_marker GL_EXT_discard_framebuffer GL EXT_鲁棒性GL_EXT_texture格式BGRA8888 GL EXT_texture类型2_10_10_10_版本glu NV围栏GL_OES压缩的纹理深度为24GL_OES_EGL_图像GL_OES_EGL_图像同步GL_OES_EGL_图像外部GL_OES元素索引GL_OES fbo渲染mipmap GL_OES_片段精度高GL_OES_获取程序二进制GL_OES_压缩深度纹理立方体贴图glu OES_rgb8 GL_OES_标准导数3D_OES_浮动纹理GL_OES_纹理_半浮体_线性GL_OES_纹理_npot GL_OES_顶点_顶点_顶点_类型_10_10_10_2 glu OES_顶点_数组_对象glu QCOM_alpha_测试GL_QCOM_组合_控制GL_QCOM_驱动程序_控制glu QCOM_性能_全局模式GL_扩展_获得glu扩展的glu QCOM_-QCOM_-QCOM_二写式渲染GL\u EXT\u sRGB\u write\u control GL\u EXT\u texture\u sRGB\u decode GL\u EXT\u multisampled\u render\u to\u texture GL\u EXT\u color\u buffer\u float GL\u EXT\u color\u buffer\u half float GL\u EXT\u disjoint\u timer\u查询
11-14 15:40:04.265:W/Adreno EGL(1654)::EGL\u BAD\u属性
11-14 15:40:04.265:W/Adreno EGL(1654)::EGL\u BAD\u属性
11-14 15:40:04.265:I/AndroidGraphics(1654):帧缓冲区:(5,6,5,0)
11-14 15:40:04.265:I/AndroidGraphics(1654):深度缓冲区:(16)
11-14 15:40:04.265:I/AndroidGraphics(1654):模具缓冲区:(0)
11-14 15:40:04.265:I/AndroidGraphics(1654):样本:(0)
11-14 15:40:04.265:I/AndroidGraphics(1654):覆盖率抽样:(假)
11-14 15:40:04.333:I/运行LiquidFun版本(1654):LiquidFun 1.1.0
11-14 15:40:04.333:I/720.0(1654):1280.0
11-14 15:40:04.429:I/AndroidInput(1654):传感器侦听器设置
11-14 15:40:09.043:I/O服务(1654):服务已销毁
11-14 15:40:09.043:I/O服务(1654):发动机暂停
11-14 15:40:09.217:E/Surface(1654):queueBuffer:将缓冲区排队到SurfaceTexture时出错,-19
11-14 15:40:09.218:W/Adreno EGLSUB(1654)::未能将缓冲区排队
11-14 15:40:09.218:W/Adreno EGL(1654)::EGL_BAD_表面
11-14 15:40:09.220:I/AndroidInput(1654):传感器侦听器损坏
11-14 15:40:09.236:E/Surface(1654):queueBuffer:将缓冲区排队到SurfaceTexture时出错,-19
11-14 15:40:09.236:W/Adreno EGLSUB(1654)::未能将缓冲区排队
11-14 15:40:09.236:W/Adreno EGL(1654)::EGL_BAD_表面
11-14 15:40:09.244:I/O维修(1654):发动机表面损坏

我发现了问题,我错误地引用了“livewallpersettings.java” 在“wallpaper.xml”文件中初始化:

相反: android:settingsActivity=“lwp.example.android.livewallperSettings

应该是: android:settingsActivity=“com.mygdx.game.android.livewallperSettings”

我使用了另一个项目作为参考,并复制了它,但没有将其更改为正确的路径。抱歉..浪费了我和其他人的时间:/


感谢您的帮助。

我发现了问题,我错误地引用了“livewallpersettings.java” 在“wallpaper.xml”文件中初始化:

相反: android:settingsActivity=“lwp.example.android.livewallperSettings

应该是: android:settingsActivity=“com.mygdx.game.android.livewallperSettings”

我使用了一个不同的项目作为参考