久久久久久久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問題)
主站蜘蛛池模板: 久久精品一区二区三区不卡牛牛 | 亚洲免费福利视频 | 国精产品99永久一区一区 | 日本国产在线观看 | 日韩福利一区 | 国产欧美精品 | www.日本黄色| 亚洲色妞| 男女插插插视频 | 999久久久精品 | 午夜伦理视频 | 午夜两性| 国产精品无遮挡 | 中文字幕一二区 | 国产成人在线观看免费网站 | 成人av一区 | 久久国产一区 | 国产日本在线 | 国产h视频在线观看 | 色黄大色黄女片免费中国 | 午夜成人免费视频 | 深夜福利视频在线观看 | 国产美女视频网站 | 国产高清视频在线播放 | 中文字幕少妇 | 国产精品日韩欧美 | 成人在线免费网站 | 日本a在线观看 | 亚洲免费网站 | 亚洲一区在线播放 | 中文字幕av网站 | 二区三区在线观看 | 精品国产aⅴ麻豆 | 国产三级精品视频 | 亚洲一区二区三区免费 | 黄色录像免费看 | 亚洲精品久久久久久久久 | 欧美视频一二三区 | 中文字幕免费 | 欧美日韩网站 | 日韩精品三区 |