久久久久久久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精品国产91久久综合桃花 | 天天噜天天干 | 国产成人精品一区二区三 | 婷婷久久精品一区二区 | 亚州精品天堂中文字幕 | 天天夜夜操| 成人在线一区二区 | 91免费在线看 | 国产一区二区三区在线视频 | 黄色网址在线免费观看 | 久久久久久国产精品 | 在线国产小视频 | 午夜小电影 | 九九看片 | 免费午夜视频 | 日韩一区二区三区视频 | 精品产国自在拍 | 欧美亚洲在线 | 久久精品16 | 国产精品视频久久 | 玖玖视频免费 | 国产在线精品一区二区三区 | 欧美精品一区二区三区四区 | 国产成人精品一区二区三区四区 | 美女爽到呻吟久久久久 | 国产精品久久久久久久久久久久午夜片 | 国产综合在线视频 | 欧美a级成人淫片免费看 | 涩爱av一区二区三区 | 免费观看羞羞视频网站 | 日日摸日日碰夜夜爽2015电影 | 久久精品国产一区二区电影 | 欧美电影大全 | 国内av在线 | 精品视频在线免费观看 | 国产中文字幕在线观看 | 天天夜碰日日摸日日澡 | 国产欧美一区二区久久性色99 |