Unity在development模式下的一个坑
来源:互联网 发布:多媒体素材集成软件 编辑:程序博客网 时间:2024/06/08 09:23
最近发现unity生成的包在Nexus上如果打开带Input控件的界面时,关闭屏幕再打开,则永远无法显示输入法界面了。
一开始还以为是unity自己本身的bug,后来发现release版本并无这个问题,于是弄了个最简单的测试版本分别打了
两个包,然后apktool解码对比发现,com/unity3d/player/UnityPlayer.smali在development模式下多了几行代码如下:
diff -r Untitled/smali/com/unity3d/player/UnityPlayer.smali keyboard/smali/com/unity3d/player/UnityPlayer.smali
310a311,355
> iget-object v0, p0, Lcom/unity3d/player/UnityPlayer;->h:Landroid/content/ContextWrapper;
>
> instance-of v0, v0, Landroid/app/Activity;
>
> if-eqz v0, :cond_5
>
> iget-object v0, p0, Lcom/unity3d/player/UnityPlayer;->h:Landroid/content/ContextWrapper;
>
> check-cast v0, Landroid/app/Activity;
>
> invoke-virtual {v0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;
>
> move-result-object v0
>
> const/high16 v1, 0x200000
>
> invoke-virtual {v0, v1}, Landroid/view/Window;->addFlags(I)V
>
> const/high16 v1, 0x80000
>
> invoke-virtual {v0, v1}, Landroid/view/Window;->addFlags(I)V
>
> const/high16 v1, 0x400000
>
> invoke-virtual {v0, v1}, Landroid/view/Window;->addFlags(I)V
addFlags这种函数之前还真没用过,于是查了一下文档发现如下说明:
public static final int FLAG_SHOW_WHEN_LOCKED
Added in API level 5
Window flag: special flag to let windows be shown when the screen is locked. This will let application windows take precedence over key guard or any other lock screens. Can be used withFLAG_KEEP_SCREEN_ON to turn screen on and display windows directly before showing the key guard window. Can be used withFLAG_DISMISS_KEYGUARD to automatically fully dismisss non-secure keyguards. This flag only applies to the top-most full-screen window.
Constant Value: 524288 (0x00080000)
public static final int FLAG_DISMISS_KEYGUARD
Added in API level 5
Window flag: when set the window will cause the keyguard to be dismissed, only if it is not a secure lock keyguard. Because such a keyguard is not needed for security, it will never re-appear if the user navigates to another window (in contrast to FLAG_SHOW_WHEN_LOCKED, which will only temporarily hide both secure and non-secure keyguards but ensure they reappear when the user moves to another UI that doesn't hide them). If the keyguard is currently active and is secure (requires an unlock pattern) than the user will still need to confirm it before seeing this window, unlessFLAG_SHOW_WHEN_LOCKED has also been set.
Constant Value: 4194304 (0x00400000)
这个参数的结果就是输入法界面不显示了,这也不知道android确实是这么设计的还是个bug了。
- Unity在development模式下的一个坑
- rails 3 disable asset在development模式下运行出错
- Unity在iOS平台下的Mono在Full AOT模式下的限制
- Unity在编辑器模式下动态创建Prefab
- UBUNTU 14.04 在 vmware workstation10下无法进入unity模式
- 问题解决:Ubuntu 12.04在vmware10下无法进入Unity模式
- Ubuntu 12.04在vmware10下无法进入Unity模式
- UBUNTU 14.04 在 vmware workstation10下无法进入unity模式
- Unity在Editor模式下查看Shader动态效果
- Unity在一个父物体下实例化子物体
- ruby类变量在development模式失效
- unity在Windows下的安装
- Debug 模式 和 Release 模式下,一个线程在"编译"上引发的问题
- <Unity UGUI><EasyTouch> 使用EasyTouch, 摇杆在Dynamic模式下,点击UI控件也会弹出的问题解决
- Unity Game Development 介绍
- plsql development工具在本地没有oracle数据库情况下连接远程服务器数据库的方法
- Unity编辑器模式下退出
- 在unity的player角色控制中实现MVC模式
- IOS设计结构-姬云鹏
- JavaEE干了8年,要不要去新加坡?
- ScrollView自动滚动问题解决方法
- java泛型代码杂谈
- exec函数族
- Unity在development模式下的一个坑
- Oracle中imp、exp命令的使用
- 用自建的函数给数组排序
- RPC应用的java实现
- more命令
- Git使用指南(加精)
- Python_Linux下编译安装Python
- grpc学习笔记--Java版
- Netty学习:搭建一个简单的Netty服务