Skip to content

Commit 11ba4fc

Browse files
committed
updated android tip
1 parent cc9e3bf commit 11ba4fc

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,44 @@ task exportJar(type: Copy) {
907907
// activityManager.removeTask(recents.get(i).persistentId,ActivityManager.REMOVE_TASK_KILL_PROCESS);
908908
}
909909
```
910+
* [手动安装apk](https://blog.csdn.net/u010218230/article/details/83824979)
911+
* Android8.0 + 版本,开启全屏的WindowManager后,后面界面响应不到触摸。 目前没有比较好解决方式,targetSdk 版本降低于26不存在改问题。
912+
* 系统语言设置
913+
```
914+
LocalePicker.updateLocale(locale);
915+
```
916+
* [反射实例化静态内部类](https://blog.csdn.net/weixin_39437369/article/details/80967134)
917+
```
918+
//demo
919+
920+
Class<?> cls;
921+
try {
922+
cls = Class.forName("com.android.internal.inputmethod.InputMethodUtils$InputMethodSettings"); //重点用 &
923+
Constructor<?> cons=null;
924+
cons=cls.getConstructor(Resources.class, ContentResolver.class, HashMap.class, ArrayList.class, int.class, boolean.class);
925+
mSettings = (InputMethodSettings) cons.newInstance(context.getResources(), context.getContentResolver(),
926+
mMethodMap, mMethodList, getDefaultCurrentUserId(),true);//创建新对象时调用构造方法
927+
} catch (ClassNotFoundException e) {
928+
// TODO Auto-generated catch block
929+
e.printStackTrace();
930+
} catch (NoSuchMethodException e) {
931+
// TODO Auto-generated catch block
932+
e.printStackTrace();
933+
} catch (InstantiationException e) {
934+
// TODO Auto-generated catch block
935+
e.printStackTrace();
936+
} catch (IllegalAccessException e) {
937+
// TODO Auto-generated catch block
938+
e.printStackTrace();
939+
} catch (IllegalArgumentException e) {
940+
// TODO Auto-generated catch block
941+
e.printStackTrace();
942+
} catch (InvocationTargetException e) {
943+
// TODO Auto-generated catch block
944+
e.printStackTrace();
945+
}
946+
947+
```
910948

911949

912950
### Development tools

0 commit comments

Comments
 (0)