1

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;

5 Answers 5

2

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{
    }
Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

0

you might not have imported class EmployeeAction.class

Comments

0

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.

Comments

-1

Import your model class to your list activity class

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.