小编Zap*_*scu的帖子

"IME死了"和android.os.DeadObjectException

我在不同的设备上测试我的游戏,其中一个(Asus Garmin A10)在用户改变音量(上/下)或按下菜单按钮等时随机(3/5次)崩溃.它可能是本机崩溃,因为我没有收到ACRA logcat(手机远离我,我只是ACRA进行远程调试).用户告诉我发生了什么.在我的HTC上我只是一个恼人的警告,但游戏运行良好,没有任何反应.这是警告:

10-31 19:52:29.547:W/InputMethodManager(8441):IME死了:com.android.inputmethod.latin/.LatinIME drop:KeyEvent {action = 0 code = 25 repeat = 0 meta = 0 scancode = 114 mFlags = 8} 10-31 19:52:29.547:W/InputMethodManager(8441):android.os.DeadObjectException 10-31 19:52:29.547:W/InputMethodManager(8441):at android.os.BinderProxy.transact(Native Method) )10-31 19:52:29.547:W/InputMethodManager(8441):at com.android.internal.view.IInputMethodSession $ Stub $ Proxy.dispatchKeyEvent(IInputMethodSession.java:277)10-31 19:52:29.547:W/InputMethodManager(8441):在android.view.inputmethod.InputMethodManager.dispatchKeyEvent(InputMethodManager.java:1344)10-31 19:52:29.547:W/InputMethodManager(8441):at android.view.ViewRoot.deliverKeyEvent(ViewRoot. java:2426)10-31 19:52:29.547:W/InputMethodManager(8441):在android.view.ViewRoot.handleMessage(ViewRoot.java:1741)10-31 19:52:29.547:W/InputMethodManager(8441) :在android.os.Handler.dispatchMessage(Handler.java:99)10-31 19:52:29.547:W/InputMethodM anager(8441):在android.os.Looper.loop(Looper.java:123)10-31 19:52:29.547:W/InputMethodManager(8441):在android.app.ActivityThread.main(ActivityThread.java:4627) )10-31 19:52:29.547:W/InputMethodManager(8441):at java.lang.reflect.Method.invokeNative(Native Method)10-31 19:52:29.547:W/InputMethodManager(8441):at java. lang.reflect.Method.invoke(Method.java:521)10-31 19:52:29.547:W/InputMethodManager(8441):at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:868 )10-31 19:52:29.547:W/InputMethodManager(8441):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)10-31 19:52:29.547:W/InputMethodManager(8441) ):at dalvik.system.NativeStart.main(Native Method)10-31 19:52:29.707:W/InputMethodManager(8441):IME死了:com.android.inputmethod.latin/.LatinIME drop:KeyEvent {action = 1 code = 25 repeat = 0 meta = 0 …

android ime

6
推荐指数
1
解决办法
1827
查看次数

Cordova - 在下载文件夹中下载文件

我已经阅读了很多帖子,但我没有得到最终答案.从这个链接的代码开始,我将我的文件下载到应用程序中.无论如何,我想看到它进入"下载"文件夹.我正在使用Android,但显然我也想要一个适用于iOS的解决方案.

file download cordova

5
推荐指数
1
解决办法
2万
查看次数

Spritesheet以编程方式切割:最佳实践

我有一个由42帧组成的大型spritesheet(3808x1632).我会用这些帧呈现一个动画,我使用一个线程来加载一个包含所有帧的位图数组,并用一个闪屏等待它的结束.我没有使用SurfaceView(和画布的绘图功能),我只是在我的主布局中的ImageView中逐帧加载.我的方法类似于从spritesheet中加载大量图像 完成实际需要大约15秒,这是不可接受的.

我用这种功能:

for (int i=0; i<TotalFramesTeapotBG; i++) {
            xStartTeapotBG = (i % framesInRowsTeapotBG) * frameWidthTeapotBG; 
            yStartTeapotBG = (i / framesInRowsTeapotBG) * frameHeightTeapotBG;
            mVectorTeapotBG.add(Bitmap.createBitmap(framesBitmapTeapotBG, xStartTeapotBG, yStartTeapotBG, frameWidthTeapotBG, frameHeightTeapotBG));
        }
Run Code Online (Sandbox Code Playgroud)

framesBitmapTeapotBG是一个很大的spritesheet.看得更深,我在logcat中读到createBitmap函数需要花费很多时间,可能是因为spritesheet太大了.我找到了一个可以在大spritesheet上创建窗口的地方,使用rect函数和canvas,创建要在数组中加载的小位图,但它并不是很清楚.我在谈论那篇文章:削减位图的一部分

我的问题是:如何加速spritesheet切割?

编辑:我正在尝试使用这种方法,但我看不到最终的动画:

    for (int i=0; i<TotalFramesTeapotBG; i++) {
        xStartTeapotBG = (i % framesInRowsTeapotBG) * frameWidthTeapotBG; 
        yStartTeapotBG = (i / framesInRowsTeapotBG) * frameHeightTeapotBG;
        Bitmap bmFrame = Bitmap.createBitmap(frameWidthTeapotBG, frameHeightTeapotBG, Bitmap.Config.ARGB_8888);
        Canvas c = new Canvas(bmFrame); 
        Rect src = new Rect(xStartTeapotBG, yStartTeapotBG, frameWidthTeapotBG, frameHeightTeapotBG); 
        Rect dst = new Rect(0, 0, frameWidthTeapotBG, …
Run Code Online (Sandbox Code Playgroud)

android bitmap sprite-sheet

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×2

bitmap ×1

cordova ×1

download ×1

file ×1

ime ×1

sprite-sheet ×1