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 6160837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:23:32+00:00 2026-05-23T21:23:32+00:00

How to implement selecting text capability on Android 2.2? I searched Google but can’t

  • 0

How to implement selecting text capability on Android 2.2? I searched Google but can’t find a solution.

  • 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-05-23T21:23:32+00:00Added an answer on May 23, 2026 at 9:23 pm

    This is the only way I’ve found (from google) to support it for android 1.6+, it works but it’s not ideal, I think in stock android you can’t hold down a webview to highlight until v2.3, but I may be mistaken..

    By the way this is for a webview, it might also work on textview, but I haven’t tried it

    (Note: this is currently what my shipped app is using, so it works with all the phones I’ve had it tested on, but the only reason I found this question was because I was searching and hoping that someone had come up with a better way by now)

    I’ve just got a menu item called “Select text” which calls the function “selectnCopy()”

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        //..
        switch (item.getItemId()) {
            case R.id.menu_select:
                selectnCopy();
                return true;
        //..
        }
    }
    

    Which looks like this:

    public void selectnCopy() {
        Toast.makeText(WebClass.this,getString(R.string.select_help),Toast.LENGTH_SHORT).show();
        try {
            KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN,
                    KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);
            shiftPressEvent.dispatch(wv);
        } catch (Exception e) {
            throw new AssertionError(e);
        }
    }
    

    Notice I’ve put the select_help string there as a toast, that’s just because it’s not immediately clear to the user how it’s supposed to work

    <string name="select_help">Touch and drag to copy text.</string>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to implement a feature where a user can select some text in
In C++, I'm looking to implement an operator for selecting items in a list
I need to implement a Diff algorithm in VB.NET to find the changes between
I was searching for the google wave-like wysiwyg editor but did not succeed on
I have a question on how to implement a dynamic text area with link
I'm looking for ways to implement text selection over a parsed PDF in iOS.
I searched ExtJS related questions and didn't found any reference, but if I missed
I'm trying to find a way to implement file manager functionality in an mvc
I'm trying to implement a dynamic OPTION list in JavaScript. Depending on other selections
On more than one occasion I've been asked to implement rules for password selection

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.