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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:23:30+00:00 2026-05-30T06:23:30+00:00

Friends, i m developing a Game. All the drawings are handled by my sSurfaceViewClass,

  • 0

Friends,

i m developing a Game.
All the drawings are handled by my sSurfaceViewClass, which is an Activity extending SurfaceView.
I overlay a few custom ui components, mainly buttons and textviews.

Everything works fine except of the overlay of the EditText.
I can not request focus for the EditText programmatically.
I want the focus on the EditText when the activty gets created. What means the keyboard pops up and the cursor is in the EditText, waiting for the input.
Heres part of my code:

            addContentView(surfaceViewClass, layoutParamsCompleteLayout);


            editTextKeyboard = new EditText(this);
            editTextKeyboard.requestFocus();
    editTextKeyboard.setAlpha(0);
    editTextKeyboard.setSingleLine();
    editTextKeyboard.setImeOptions(EditorInfo.IME_FLAG_NO_FULLSCREEN);
    editTextKeyboard.setFocusableInTouchMode(true);

            addContentView(editTextKeyboard, layoutParamsCompleteLayout);

with the method requestFocus() it works usually fine. But in this case ( surfaceView plus overlay ) it does not.

I m glad about any support. Also a workaround would help me a lot!

Thx

  • 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-30T06:23:31+00:00Added an answer on May 30, 2026 at 6:23 am

    try using requestFocus() after adding it to surface view.

    You are doing it before you add it to parent layout.

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

Sidebar

Related Questions

Greetings Friends, I am trying to overlay the simple 2D game I am developing
friends. I'm developing a flex mobile app. I've declared a Titlewindow which contains the
Hello friends I am developing application in which view has one textField & 2
I am developing in which i am getting my events and my friends events
I'm developing a facebook iframe app (page app), which counts the user's friends that
I am developing a website using CodeIgniter and PHP. Some of my friends suggest
I am developing a simple library in C, for my own + some friends
friends, i have created custom title bar using following titlebar.xml file with code <?xml
Friends, I like to know using which version of Android SDK we can develop
I am currently interested in game developing. I know a little bit of C#

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.