Solved

DisplayMessageActivity not a type?

Posted on 2014-11-03
4
421 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:knowlton
  • 2
  • 2
4 Comments
 
LVL 16

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: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 16

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:knowlton
ID: 40433027
>>>>This can be useful when doing poorly constructed tutorials.

LOL
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Where to begin studying? 5 66
.NET Error 7 42
C# Export DataGridView 4 39
Samsung Android Marshmallow + autostart apps on boot 7 50
This is an explanation of a simple data model to help parse a JSON feed
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now