user886420
user886420

Reputation:

Cannot be resolved to a type.. (Java)

I'm fairly new to programming in general so any help would be appreciated. Im coding in java with eclipse and I am getting this error on the last line "EmployeeAction cannot be resolved to a type" and I already imported java.util.ArrayList. Any idea on what I'm doing wrong? Thanks

EDIT: Thanks All. I was following a tutorial

It provided the code for EmployeeDetails.java here which I guess is wrong:

package samples.employeedirectory;

import java.util.ArrayList;
import java.util.List;

import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class EmployeeDetails extends ListActivity {

protected TextView employeeNameText;
protected TextView titleText;
protected ArrayList<EmployeeAction> actions;

Upvotes: 1

Views: 8282

Answers (5)

Anuradha Jayalath
Anuradha Jayalath

Reputation: 29

Import your model class to your list activity class

Upvotes: -1

android
android

Reputation: 600

I can't comment.So writing as answer

You need to have a class name EmployeeAction Import the class or create it as an inner class

  class EmployeeAction{
    }

Upvotes: 2

Gapton
Gapton

Reputation: 2124

fomr the look of your code, EmployeeAction is a class. Have you defined this class? Have you defined it in the same package? If not, you will need to import it.

Upvotes: 0

ngesh
ngesh

Reputation: 13501

you might not have imported class EmployeeAction.class

Upvotes: 0

asgs
asgs

Reputation: 3984

Since actions is an ArrayList of EmployeeAction, you should also import EmployeeAction as it looks like a user defined type.

Upvotes: 1

Related Questions