Android12/13 解决WiFi输入框被遮挡问题

/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/wifi/

WifiConfigController2.java

public WifiConfigController2(WifiConfigUiBase2 parent, View view, WifiEntry wifiEntry,
int mode) {
mConfigUi = parent;
mView = view;
mWifiEntry = wifiEntry;
mContext = mConfigUi.getContext();

// Init Wi-Fi manager
mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
initWifiConfigController2(wifiEntry, mode);
//*/ 20230508,solve inputmethod popup causing Edit Error && Cast Exception 1
(scanForActivity(mContext)).getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
//*/

}
//*/2023058,solve inputmethod popup cause Edit Error && Cast Exception 2
private static Activity scanForActivity(Context cont) {

if (cont == null)
return null;
else if (cont instanceof Activity)
return (Activity)cont;
else if (cont instanceof ContextWrapper)
return scanForActivity(((ContextWrapper)cont).getBaseContext());
return null;
}
//*/
@VisibleForTesting
public WifiConfigController2(WifiConfigUiBase2 parent, View view, WifiEntry wifiEntry,
int mode, WifiManager wifiManager) {
mConfigUi = parent;

mView = view;
mWifiEntry = wifiEntry;
mContext = mConfigUi.getContext();
mWifiManager = wifiManager;
initWifiConfigController2(wifiEntry, mode);
}

相关推荐
zhangphil8 分钟前
Android性能:trace上的锁竞争monitor contention with owner at
android
qq_3482318518 分钟前
Spring Boot开发过程中常见问题
java·spring boot·后端
程序修理员20 分钟前
java+vue实现文件下载进度条
java·开发语言·vue.js
毕设源码-赖学姐28 分钟前
【开题答辩全过程】以 高校教师管理系统设计与实现为例,包含答辩的问题和答案
java·eclipse
不会代码的小猴32 分钟前
C++的第十一天笔记
java·前端·jvm
雨中飘荡的记忆34 分钟前
Javassist实战
java
砖厂小工35 分钟前
Now In Android 精讲 9 - Benchmark 与 Baseline Profile
android
陈文锦丫41 分钟前
微服务-----
java·数据库·微服务
任子菲阳42 分钟前
学Java第五十三天——IO综合练习(1)
java·开发语言·爬虫