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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:36:56+00:00 2026-06-16T17:36:56+00:00

I tried to follow the android tutorial but after I try to run the

  • 0

I tried to follow the android tutorial but after I try to run the code this error appears.
Here is my MainActivity.

    package com.example.menuexample;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;


public class MainActivity extends Activity {
    public final static String EXTRA_MESSAGE="com.example.menuexample.MESSAGE";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void sendMessage(View view){ 
        Intent intent = new Intent(this, DisplayMessageActivity.class); 
        EditText editText= (EditText) findViewById(R.id.edit_message);  --HERE
        String message = editText.getText().toString();
        intent.putExtra(EXTRA_MESSAGE, message);
        startActivity(intent); 
    }


}

I have got in the activity_main :

<EditText
    android:id="@+id/editText1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:hint="@string/edit_message" >

</EditText>

Also , strings.xml has:

<string name="edit_message">Test</string>
  • 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-06-16T17:36:58+00:00Added an answer on June 16, 2026 at 5:36 pm

    Change

    EditText editText= (EditText) findViewById(R.id.edit_message); 
    

    to

    EditText editText= (EditText) findViewById(R.id.editText1); 
    

    because you have declared Edittext with editText1 id in xml layout but you are trying to find control id which is not exist

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

Sidebar

Related Questions

I try to follow the facebook-android tutorial from here: https://developers.facebook.com/docs/mobile/android/build/#sample I am working in
I tried to follow this but the default modelbinder let my array null on
I think i follow instruction from this site very carefully http://source.android.com/source/downloading.html but when i
I tried to follow this instruction: http://wiki.phonegap.com/w/page/16494774/Getting-started-with-Android-PhoneGap-in-Eclipse I can run the example but when
I tried to follow this answer about sending MMS through code. However, I stopped
I tried to follow many online tutorials to run kmeans example present in Mahout.
I have started using Simple-form and Bootstrap and I have tried to follow this
I want to tail multiple files (and follow them) in CentOS, I've tried this:
I'm trying to follow instructions from Android developers site but I must be doing
I created a new android project using this tutorial and it works fine. I

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.