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

  • SEARCH
  • Home
  • 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 7671717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:07:18+00:00 2026-05-31T16:07:18+00:00

I gave android:singleLine=true option on EditTextPreference , and when the edit box in the

  • 0

I gave android:singleLine="true" option on EditTextPreference, and when the edit box in the dialog has the focus, the software keyboard shows “Done” button in place of Enter key. However if I press the done button, only the software keyboard closes, and I still have to click Done button on the dialog.

Is there anyway to make enter key and ime action key on the software keyboard to close the dialog and apply the new value?

  • 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-31T16:07:19+00:00Added an answer on May 31, 2026 at 4:07 pm

    First, I set the IME Option to IME_ACTION_DONE

    mEditTextPreference.getEditText().setImeOptions(EditorInfo.IME_ACTION_DONE);
    

    and then using following code to save value and close dialog.

    mEditTextPreference.getEditText().setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE){
                //mEditTextPreference.setText(mEditTextPreference.getEditText().getText().toString());
    
                //better solution
                mEditTextPreference.onClick(mEditTextPreference.getDialog(), Dialog.BUTTON_POSITIVE);
                mEditTextPreference.getDialog().dismiss();
                return true;
            }
            return false;
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My android app leaks, what should I check? I gave a look at avoiding
I developed application on 1.6.in manifest i gave: <uses-sdk android:minSdkVersion=3 android:targetSdkVersion=4/>. When I run
I have a android iso inside virtual box. I need to mount the /system
I gave an empty string. Lint still complains. <ImageView style=@style/DetailFieldSeparator/> <style name=DetailFieldSeparator> <item name=android:src>@android:drawable/divider_horizontal_textfield</item>
I was continuing work on my Android tutorial that my teacher gave to me.
I created an Android app which has an FTP connection, however when I start
I am creating a method to displays the installed applications in android. I gave
My boss recently gave me an HTC Wildfire phone for doing an Android version
I am new to android, i am trying a broadcast demo, I gave my
@swatkins gave a fantastic answer to his own question about using jQuery templates with

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.