gpt4 book ai didi

javascript - 我需要 map 应用程序代码部分的帮助以及 setOnEditorActionListener 的问题?

转载 作者:行者123 更新时间:2023-11-28 03:44:32 25 4
gpt4 key购买 nike

my getAction() method is not working. What should I do? how can i replace it to get it work i need need way to write it again

private void init(){
Log.d(TAG,"init: initializing");
mSearchText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((actionId == EditorInfo.IME_ACTION_SEARCH)
|| (actionId == EditorInfo.IME_ACTION_DONE)
|| (KeyEvent.getAction() == KeyEvent.ACTION_DOWN)
|| (KeyEvent.getAction() == KeyEvent.KEYCODE_ENTER)){
geoLocate();
}
return false;
}
});
}

最佳答案

您应该使用 onEditorAction 中的对象,而不是将“KeyEvent.getAction()”更改为“event.getAction()”

关于javascript - 我需要 map 应用程序代码部分的帮助以及 setOnEditorActionListener 的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48633531/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com