Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有 EditText 的应用程序,其中包含一些文本。我想创建一个事件来检索我在 EditText 组件中触摸的单词。我怎么做?
提前致谢
科比
你可以selected word从你的编辑文本中得到..
selected word
String text=yourEditText.getText().toString(); String slectedWord=text.subSequence(yourEditText.getSelectionStart(), yourEditText.getSelectionEnd());