Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DisplayMessageActivity not a type?

Posted on 2014-11-03
4
Medium Priority
?
682 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here, we have shared an easy step by step tutorial on how to download instagram images and videos on PC, Android Mobile and iOS mobile.
These days software publishers make it possible to move all the possible applications on smartphones, tablets, smartwatches, and more. Although behind every logic and decision is a gross doubt: how do they make it possible? In this blog post, we sha…
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.

660 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