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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:18:06+00:00 2026-06-10T00:18:06+00:00

Starting an app here: http://developer.android.com/training/basics/firstapp/index.html Copying directly from the tutorial and it’s full of

  • 0

Starting an app here:

http://developer.android.com/training/basics/firstapp/index.html

Copying directly from the tutorial and it’s full of errors. Even if I copy and paste. Is there a repository where I can view the working files and see if there’s anything wrong?

For example, in MainActivity.java:

package com.example.my.first.app;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity {
public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";
/** Called when the user clicks the Send button */
public void sendMessage(View view) {
    Intent intent = new Intent(this, DisplayMessageActivity.class);
    EditText editText = (EditText) findViewById(R.id.edit_message);
    String message = editText.getText().toString();
    intent.putExtra(EXTRA_MESSAGE, message);
    startActivity(intent);
}

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}
}

but it returns:

“View cannot be resolved to type” on line 10
“Multiple Markers at this line: Intent cannot be resolved to type” on line 11
“Multiple Markers at this line: EditText cannot be resolved to a type” on line 12

Then in DisplayMessageActivity.java:

package com.example.my.first.app;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;

public class DisplayMessageActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Get the message from the intent
    Intent intent = getIntent();
    String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);

    // Create the text view
    TextView textView = new TextView(this);
    textView.setTextSize(40);
    textView.setText(message);

    // Set the text view as the activity layout
    setContentView(textView);
}
}

and it returns:

“Intent cannot be resolved to type” on line 12
“Multiple Markers at this line: TextView cannot be resolved to a type” on line 16

This is my first app and I figured following the official tutorial would be alright but it’s not working. I’m using the latest Eclipse and Andorid SDK (downloaded tonight as a matter of fact.)

  • 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-10T00:18:08+00:00Added an answer on June 10, 2026 at 12:18 am

    You have to import it.

    On the left-side on eclipse there is an incon with a “X”, click on it and select “Import ‘XXXX'”.

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

Sidebar

Related Questions

I was testing the first app (see http://developer.android.com/training/basics/firstapp/starting-activity.html ) at a point,I stuck.. it
I was following the Dev guide on google: http://developer.android.com/training/basics/firstapp/starting-activity.html Eclipse gives me this error
I was following the Dev guide on Google's site: http://developer.android.com/training/basics/firstapp/starting-activity.html But whenever I press
I'm using Eclipse with ADT and I'm following this tutorial: http://developer.android.com/training/basics/firstapp/starting-activity.html to make an
I have an issue with my app when starting an SimpleBaseGameActivity from another SimpleBaseGameActivity
I'm starting Android Market via my app to search for similar products using this
The diagram http://www.freeimagehosting.net/uploads/2fd3f4161c.png Here's the Minimalist-UML diagram of an app I've been working on.
Using the basic starting app from XCode for a navigation based application, I'm trying
I'm following the guide here: http://webtempest.com/how-to-allow-image-uploads-in-rails-on-heroku/ And I am getting an error whenever I
I've installed RoR in my MacOS X using this guide http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/ Here my versions:

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.