动态壁纸崩溃时,水龙头上的设置 [英] Live Wallpaper crash when tap on Settings

查看:188
本文介绍了动态壁纸崩溃时,水龙头上的设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

传真当我敲击的设置... 的按钮,在动态壁纸选择器它停下来。然后停止我的动态壁纸了。

你能帮助我吗?

wallpaper.xml

 <?XML版本=1.0编码=UTF-8&GT?;<壁纸的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
机器人:缩略图=@绘制/ ic_bubbles
机器人:名字=@字符串/ APP_NAME
机器人:说明=@字符串/ APP_NAME
机器人:settingsActivity =com.chovanec.bubbles.Settings_activity/>

Settings_activity.java

 包com.chovanec.bubbles;进口android.os.Bundle;
进口android.app.Activity;
进口android.util.Log;
进口android.view.Menu;公共类Settings_activity延伸活动{    @覆盖
    公共无效的onCreate(捆绑savedInstanceState){
        Log.d(活动的onCreate,);
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.settings_layout);
    }    @覆盖
    公共布尔onCreateOptionsMenu(菜单菜单){
        返回true;
    }
}

settings_layout.xml

 <的RelativeLayout的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    的xmlns:工具=htt​​p://schemas.android.com/tool​​s
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent>    <的TextView
        机器人:layout_width =WRAP_CONTENT
        机器人:layout_height =WRAP_CONTENT
        机器人:layout_centerHorizo​​ntal =真
        机器人:layout_centerVertical =真
        机器人:文字=你好,世界!
        工具:上下文=。Settings_activity/>< / RelativeLayout的>

的Andr​​oidManifest.xml

 <清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    包=com.chovanec.bubbles
    安卓版code =3
    机器人:=的versionName1.2>    <采用-SDK安卓的minSdkVersion =8机器人:targetSdkVersion =15/>    <应用机器人:标签=@字符串/ APP_NAME
        机器人:图标=@绘制/ ic_bubbles
        机器人:主题=@风格/ AppTheme>        <服务机器人:标签=泡沫通过MCH
        机器人:名字=泡沫
        机器人:权限=android.permission.BIND_WALLPAPER>            &所述;意图滤光器>
                <作用机器人:名字=android.service.wallpaper.WallpaperService/>
            &所述; /意图滤光器>            <元数据机器人:名字=android.service.wallpaper
            机器人:资源=@ XML /壁纸/>        < /服务>    < /用途>    <使用特征的android:NAME =android.software.live_wallpaper/>
< /清单>

LogCat中
这里是logcat的

  10月1日至11日:57:37.990:E /跟踪(1960):错误打开跟踪文件:没有这样的文件或目录(2)
10月1日至11日:57:38.150:D / gralloc_goldfish(1960年):无仿真模拟GPU检测。
10月1日至11日:57:57.801:E / SurfaceTextureClient(1960年):queueBuffer:错误排队缓冲区表面纹理,-19
10月1日至11日:57:57.801:E / SurfaceTextureClient(1960年):queueBuffer(手柄= 0x2a1099b0)失败(没有这样的设备)
10月1日至11日:57:57.801:D / AndroidRuntime(1960年):关闭VM
10月1日至11日:57:57.801:W / dalvikvm(1960年):主题ID = 1:螺纹未捕获的异常退出(组= 0x40a13300)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):致命异常:主要
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):java.lang.IllegalArgumentException异常
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在android.view.Surface.unlockCanvasAndPost(本机方法)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在com.android.internal.view.BaseSurfaceHolder.unlockCanvasAndPost(BaseSurfaceHolder.java:215)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在com.chovanec.bubbles.Bubbles $ BubblesE​​ngine.draw(Bubbles.java:116)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在com.chovanec.bubbles.Bubbles $ BubblesE​​ngine.access $ 0(Bubbles.java:68)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在com.chovanec.bubbles.Bubbles $ BubblesE​​ngine $ 1.run(Bubbles.java:50)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在android.os.Handler.handleCallback(Handler.java:615)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在android.os.Handler.dispatchMessage(Handler.java:92)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在android.os.Looper.loop(Looper.java:137)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在android.app.ActivityThread.main(ActivityThread.java:4745)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在java.lang.reflect.Method.invokeNative(本机方法)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在java.lang.reflect.Method.invoke(Method.java:511)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:786)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10月1日至11日:57:57.940:E / AndroidRuntime(1960年):在dalvik.system.NativeStart.main(本机方法)
10月1日至11日:58:00.3​​60:I /流程(1960年):发送信号。 PID:1960年SIG:9
10月1日至11日:58:05.590:E /跟踪(1994):错误打开跟踪文件:没有这样的文件或目录(2)
10月1日至11日:58:05.920:D / gralloc_goldfish(1994年):无仿真模拟GPU检测。
10月1日至11日:58:32.749:D / dalvikvm(1994):GC_CONCURRENT释放47K,2%自由8356K / 8455K,暂停73ms + 42ms,总271ms


解决方案

需要申报 manfiest.xml

您的活动

 <活动
        机器人:名字=。Settings_activity
        机器人:configChanges =keyboardHidden |方向
        机器人:出口=真/>

allways when i tap on Settings... button in Live Wallpaper Picker it stop. And then stop my Live Wallpaper too.

Can you help me?

wallpaper.xml

<?xml version="1.0" encoding="UTF-8"?>

<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:thumbnail="@drawable/ic_bubbles"
android:name="@string/app_name"
android:description="@string/app_name"
android:settingsActivity="com.chovanec.bubbles.Settings_activity"/>

Settings_activity.java

package com.chovanec.bubbles;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;

public class Settings_activity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        Log.d("activity onCreate", "");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.settings_layout);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return true;
    }
}

settings_layout.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="Hello, world!"
        tools:context=".Settings_activity" />

</RelativeLayout>

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.chovanec.bubbles"
    android:versionCode="3"
    android:versionName="1.2">

    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />

    <application android:label="@string/app_name"
        android:icon="@drawable/ic_bubbles"
        android:theme="@style/AppTheme">

        <service android:label="Bubbles by MCh"
        android:name="Bubbles"
        android:permission="android.permission.BIND_WALLPAPER">

            <intent-filter>
                <action android:name="android.service.wallpaper.WallpaperService" />
            </intent-filter>

            <meta-data android:name="android.service.wallpaper"
            android:resource="@xml/wallpaper" />

        </service>

    </application>

    <uses-feature android:name="android.software.live_wallpaper" />
</manifest>

LogCat here is logcat

01-11 10:57:37.990: E/Trace(1960): error opening trace file: No such file or directory (2)
01-11 10:57:38.150: D/gralloc_goldfish(1960): Emulator without GPU emulation detected.
01-11 10:57:57.801: E/SurfaceTextureClient(1960): queueBuffer: error queuing buffer to SurfaceTexture, -19
01-11 10:57:57.801: E/SurfaceTextureClient(1960): queueBuffer (handle=0x2a1099b0) failed (No such device)
01-11 10:57:57.801: D/AndroidRuntime(1960): Shutting down VM
01-11 10:57:57.801: W/dalvikvm(1960): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
01-11 10:57:57.940: E/AndroidRuntime(1960): FATAL EXCEPTION: main
01-11 10:57:57.940: E/AndroidRuntime(1960): java.lang.IllegalArgumentException
01-11 10:57:57.940: E/AndroidRuntime(1960):     at android.view.Surface.unlockCanvasAndPost(Native Method)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at com.android.internal.view.BaseSurfaceHolder.unlockCanvasAndPost(BaseSurfaceHolder.java:215)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at com.chovanec.bubbles.Bubbles$BubblesEngine.draw(Bubbles.java:116)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at com.chovanec.bubbles.Bubbles$BubblesEngine.access$0(Bubbles.java:68)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at com.chovanec.bubbles.Bubbles$BubblesEngine$1.run(Bubbles.java:50)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at android.os.Handler.handleCallback(Handler.java:615)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at android.os.Looper.loop(Looper.java:137)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at android.app.ActivityThread.main(ActivityThread.java:4745)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at java.lang.reflect.Method.invokeNative(Native Method)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at java.lang.reflect.Method.invoke(Method.java:511)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-11 10:57:57.940: E/AndroidRuntime(1960):     at dalvik.system.NativeStart.main(Native Method)
01-11 10:58:00.360: I/Process(1960): Sending signal. PID: 1960 SIG: 9
01-11 10:58:05.590: E/Trace(1994): error opening trace file: No such file or directory (2)
01-11 10:58:05.920: D/gralloc_goldfish(1994): Emulator without GPU emulation detected.
01-11 10:58:32.749: D/dalvikvm(1994): GC_CONCURRENT freed 47K, 2% free 8356K/8455K, paused 73ms+42ms, total 271ms

解决方案

Need to declare your activity in manfiest.xml

    <activity
        android:name=".Settings_activity"
        android:configChanges="keyboardHidden|orientation"
        android:exported="true" />

这篇关于动态壁纸崩溃时,水龙头上的设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆