久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Android按“Enter"后執行功能對于 EditText

Android execute function after pressing quot;Enterquot; for EditText(Android按“Enter后執行功能對于 EditText)
本文介紹了Android按“Enter"后執行功能對于 EditText的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我一直在關注官方的 Android 教程,但不知何故遇到了 這個非常簡單的例子在為 EditText 按下Enter"后執行一個函數.

I have been following the official Android tutorials and somehow am having a problem with this very simple example to execute a function after pressing "Enter" for an EditText.

我明白我應該做什么,并且似乎所有設置都正確,但 Eclipse 抱怨這行:

I understand what I'm supposed to do and seem to have everything setup properly, but Eclipse is complaining with this line:

edittext.setOnKeyListener(new OnKeyListener() {

它在 setOnKeyListener 下標出錯誤:

View類型中的setOnKeyListener(View.OnKeyListener)方法不適用于參數(new DialogInterface.OnKeyListener(){})

The method setOnKeyListener(View.OnKeyListener) in the type View is not applicable for the arguments (new DialogInterface.OnKeyListener(){})

并且還用錯誤在 OnKeyListener 下劃線:

And also underlines OnKeyListener with the error:

類型new DialogInterface.OnKeyListener(){}必須實現繼承的抽象方法DialogInterface.OnKeyListener.onKey(DialogInterface, int, KeyEvent)

The type new DialogInterface.OnKeyListener(){} must implement the inherited abstract method DialogInterface.OnKeyListener.onKey(DialogInterface, int, KeyEvent)

也許有人可以朝正確的方向射擊我?在我嘗試其他解決方案(我已經在 stackoverflow 上找到)之前,我真的很想弄清楚這一點,因為它讓我感到慌亂,作為官方教程,這么簡單的東西似乎不起作用.

Perhaps someone can shoot me in the right direction? Before I try other solutions (which I've already found on stackoverflow), I'd really like to figure this out because it has me flustered that something so simple to follow, as an official tutorial, doesn't seem work.

推薦答案

據我所知,您的導入似乎有誤.

From what I can see, It looks like you have the wrong import.

試試

edittext.setOnKeyListener(new View.OnKeyListener() {

或者添加這個導入

import android.view.View.OnKeyListener;

并刪除這個

import android.content.DialogInterface.OnKeyListener;

這篇關于Android按“Enter"后執行功能對于 EditText的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Cut, copy, paste in android(在android中剪切、復制、粘貼)
android EditText blends into background(android EditText 融入背景)
Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數的數字)
Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 一级电影免费看 | 亚洲一区二区三区四区av | 欧美日韩中文在线 | 精品久久香蕉国产线看观看亚洲 | 欧美在线精品一区 | 91免费观看在线 | 蜜臀久久99精品久久久久野外 | 欧美日韩国产在线观看 | 欧美第一区 | 毛片大全| 国产a级黄色录像 | 欧美成年黄网站色视频 | 在线视频一区二区三区 | 久久69精品久久久久久久电影好 | 亚洲精品视频观看 | 日本一区二区三区在线观看 | 91极品欧美视频 | 国产一区亚洲二区三区 | 最新中文字幕一区 | 国产免费一区二区 | 亚洲不卡在线视频 | 国产有码 | 亚洲在线看 | 国产男女视频网站 | 午夜影院操 | 九热在线| 一区二区三区视频在线观看 | 在线欧美一区 | 亚洲一区电影 | 亚洲欧美在线视频 | 91精品国产综合久久精品 | 91新视频 | xxx视频| 羞羞涩涩在线观看 | 天天操天天摸天天干 | 国产精品毛片久久久久久久 | 国产激情一区二区三区 | 久久久蜜臀国产一区二区 | 九九热在线免费视频 | 交专区videossex农村 | 精品久久久久久 |