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.
私はアンドロイドでカスタムInputConnectionに取り組んでいます。すべて正常に動作していますが、カーソルの現在の位置と特定の単語の開始位置の間の文字を取得したいと考えています。
何か提案はありますか?どうやってやるの?
ありがとう..
getSelectionStart() がここでの答えかもしれません。カーソルの位置を返します。次に、テキストを 0 からその位置まで解析します。これは TextView から来ています。
その情報を InputConnection から取得したい場合、そこにカーソル位置を取得するための API がないため、難しいです。