Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8125539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:51:13+00:00 2026-06-06T06:51:13+00:00

I am trying to build an Android input control which allows the user to

  • 0

I am trying to build an Android input control which allows the user to construct a paragraph of text by bolting together different set phrases, and subsequently editing them. For instance, the following set phrases might be pre-defined:

  • proceed miles
  • north
  • south
  • look up
  • start digging for treasure
  • dig down metres below ground level

More than one phrase will be needed to construct a paragraph that makes sense. Furthermore, the phrases themselves, once entered, will need to be editable: for instance, in the first set phrase, a number will have to be inserted between “proceed” and “miles”. Here is an example of a paragraph that might conceivable be contructed with the help of such phrases:

Proceed 42 miles north, look up to the skies, then proceed 21 miles south. Start digging for treasure, and dig down 3 metres below ground level.

So far I’ve tried two main ways to accomplish this:

  1. I tried adding a context menu to the EditText, brought up by a long-press. The context menu’s entries each corresponded to a set phrase. Unfortunately, the build-in Android long press menu took over (cut/copy/paste options), thus preventing my context menu from ever being seen.

  2. I tried using a MultiAutoCompleteTextView with a CommaTokenizer, loading the phrases from a resource file. This seemed promising, but it forces a comma after each phrase. Furthermore, it becomes pretty user-unfriendly to edit – backspacing the comma deletes the entire inserted phrase. I suppose constructing an entirely new Tokenizer is a possibility, but I don’t see what token I could actually use, nor how to prevent the deletion of the entire token when backspace is tapped.

  3. I took a different approach and looked at the Android user dictionary, to see whether I could add phrases in that. Unfortunately it seems it won’t accept phrases with spaces in them.

Has anyone any advice as to what I could try next?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:51:20+00:00Added an answer on June 6, 2026 at 6:51 am

    I solved this by subclassing MultiAutoCompleteTextView and overriding the replaceText() method to not “mark as replaced” the entered phrase. Works fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey i'm trying to build an app in which the user can input some
I'm trying to build an android app that allows user to play a game
I am trying to build an android app which utilizes the camera, but only
Hi I'm a newbie in Android Programming. I'm trying to build an activity which
I'm trying to build an Android application in which the client authenticating to the
I am trying to build an android application which changes the alert profile of
I'm trying to build an android app that would do a local search on
i am trying to build an android application in relation to cloud computing. it
I am trying to build my android project using ant in command line mode.
I'm trying build an App Engine connected Android application and am having some problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.