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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:00:22+00:00 2026-05-23T03:00:22+00:00

package com.example.android.home; import android.app.Activity; import android.os.Bundle; import android.widget.*; import android.view.*; public class HomeActivity extends

  • 0
package com.example.android.home;

import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
import android.view.*;
public class HomeActivity extends Activity {
    /** Called when the activity is first created. */
  private EditText input;
  private EditText result;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        input = (EditText) findById(R.id.input1);
        result = (EditText) ***findById***(R.id.result); //Error:Undefined for the type HomeActivity

        input.addKeyListener(new View.OnKeyListener() {   Error: Undefined for the type EditText
            public boolean onKey(View v, int keycode, KeyEvent keyevent) {      
                if (keyevent.getAction() == KeyEvent.ACTION_UP) {            
                    doCalculation();      
                    }          
                return false;       
                }    
            }); 
            }
     private void doCalculation()
     {
             String strValue = input.getText().toString();
             int resultt = Integer.parseInt(strValue) * 2;
             result.setText("Result: "+ resultt);  

     }

}
  • 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-23T03:00:22+00:00Added an answer on May 23, 2026 at 3:00 am

    As @Varun states, there is no findById() method. You are probably thinking of findViewById().

    You would have found this on your own by examining any sample Android activity and seeing how it accesses the widgets. There are many sample activities in your SDK installation, plus online.

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

Sidebar

Related Questions

02-18 00:02:08.432: ERROR/PackageManager(57): Package com.example.brown requires unavailable shared library com.google.android.maps; failing! I got this
Let's say I have a file called test.txt within the package com.test.io within my
Given a property: <property name=classes value=com.package.Class1,com.package.Class2 /> I'm trying to compile only the classes
What are some good package naming conventions for domain specific object models. For example,
So most Java resources when speaking of packages mention a com.yourcompany.project setup. However, I
I package our server releases into zip files using a batch file (Windows), running
I'm receiving Package Load Failure error when I open VS 2005 after I installed
I have an SSIS package, which depending on a boolean variable, should either go
Is there a Java package providing funcionality like the .Net System.Data namespace ? Specificaly
I'd like to package a C# windows service project so it can be easily

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.