Solved

DisplayMessageActivity not a type?

Posted on 2014-11-03
4
546 Views
Last Modified: 2014-11-10
Noob developing Android apps.


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);
    }

Open in new window


Does not know what DisplayMessageActivity is.  It says:

DisplayMessageActivity cannot be resolved to a type.

Here are my includes:

package com.netendeavor.ws;

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

//DisplayMessageActivity.class;

import android.app.Activity;
import android.content.Intent;
import android.widget.TextView;
import android.view.View;
import android.os.Bundle;
0
Comment
Question by:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Chris Harte earned 500 total points
ID: 40420122
Another google cockup by the looks of it. If you are doing the google tutorial, read this solution

http://stackoverflow.com/questions/13190256/displaymessageactivity-cannot-be-resolved-to-a-type-building-first-android-app/15978679#15978679
0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 40422599
They don't explain that later on you create an activity fragment for the class in question.  Meh.

I was left thinking this was some sort of built-in method.
0
 
LVL 17

Expert Comment

by:Chris Harte
ID: 40423773
You are not the first to be caught out by this. If you are using eclipse (and I assume android studio), when you mouse over a class name it will pop up its declaration, whether it is a library function or one of your own. If it does not exist it will tell you and give you the option of creating it. This can be useful when doing poorly constructed tutorials.
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 40433027
>>>>This can be useful when doing poorly constructed tutorials.

LOL
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
If you use the Google Now Launcher, as an aftermarket add on, have a Samsung Note 5 and are worried about power consumption be wary of using the ultra power saving mode.  Here is what happened to me when I made the mistake of trying this out...
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question