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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:13:28+00:00 2026-05-31T08:13:28+00:00

I have an application that is just a surfaceview. All i do is draw

  • 0

I have an application that is just a surfaceview. All i do is draw stuff on the surfaceview and whatnot. So one functionality i want is if the user touches a corner of the surfaceview it shows the keyboard and then they can type into it. Note that there are no EditTexts or Textboxes in my app anywhere. How do i call the keyboard to pop up and then how do i get all the keys that the user is pressing? I don’t want the keys necessarily, i just want the string that they typed. How do i go about accomplishing this?

  • 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-31T08:13:29+00:00Added an answer on May 31, 2026 at 8:13 am

    This is not a trivial task.

    First of all, you’ll need to override the method onCreateInputConnection()

    @Override 
    public InputConnection onCreateInputConnection(EditorInfo outAttrs) { 
        return new MyInputConnection(this, surfaceView, false);    
    }
    

    Then you’ll have to implement this input connection class, deriving from BaseInputConnection.

    class MyInputConnection extends BaseInputConnection{
    
        private MyActivity activity;
    
        public MyInputConnection(MyActivity activity, View targetView, boolean fullEditor)
        {
           super( targetView, fullEditor );
           mActivity = activity;
        }
    
        public boolean commitText(CharSequence text, int newCursorPosition){ 
            myActivity.drawText((String) text); 
            return true; 
        } 
    

    There are more methods you’ll want to override (see the reference), but start by focusing on commitText(). DrawText() is a method that renders the text on your surface, you’ll have to come up with an implementation that suits your needs.

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

Sidebar

Related Questions

So basically I have an application that works with just one user, but I'd
i trying to make a osx application that just have one window and it
I have a WPF application that has just one button. When the button is
I have an application that behaves oddly, and just to verify, I'd like to
I have an application that imports data from a pickled file. It works just
I currently have a UINavigationController based application that works just fine. I'd like to
I have a WCF service and a Silverlight application that work just fine when
I have a web application that runs fine under IIS5 or IIS6. I just
I have just been involved in writing an application that does not use Doctype's
In my application I have groups which are essentially just tags that can be

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.