Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DisplayMessageActivity not a type?

Posted on 2014-11-03
4
Medium Priority
?
750 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
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Chris Harte earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
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.

824 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