Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1033129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:11:08+00:00 2026-05-16T14:11:08+00:00

Good evening everyone! I am working on learning some java and I have made

  • 0

Good evening everyone! I am working on learning some java and I have made it to the notepad tutorial and when I go to run it on the emulator, I am getting a few errors, and I’m hoping someone here may be able to help.

package com.a8a.todolist;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.ArrayAdapter;
import android.view.View.OnClickListener;

public class ToDoList extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        //Inflat your view
        setContentView(R.layout.main);

        //Get references to UI widgets
        ListView myListView = (ListView)findViewById(R.id.myListView);
        final EditText myEditText = (EditText)findViewById(R.id.myEditText);

        //Create the array list of to do items
        final ArrayList<String> todoItems = new ArrayList<String>();
        //Create the array adapter to bind the array to the listview
        final ArrayAdapter<String> aa;
        **aa = new ArayAdapter<String>(this, android.R.layout.simple_list_item_1,todoItems);**    *Multiple markers at this line    - ArayAdapter cannot be resolved to a type  - Line breakpoint:ToDoList [line: 27] - onCreate*
     (Bundle)
        //Bind the arary adapter to the listview.
        myListView.setAdapter(aa);

        **myEditText.setOnKeyListener(new OnKeyListener() {**  *OnKeyListener cannot be resolved to a type*
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                if (event.getAction() == KeyEvent.ACTION_DOWN)
                    if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER)
                    {
                        todoItems.add(0, myEditText.getText().toString());
                        aa.notifyDataSetChanged();
                        myEditText.setText("");
                        return true;
                    }
                return false;
            }
        });
    }
}[/CODE]

The bolded text is whats getting the error and the italics are the error itself. Any help would be appreciated, if you are able to explain why the change needs to be made as well that would be much appreciated, so I can learn from my mistakes.

Thanks in advance!

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:11:09+00:00Added an answer on May 16, 2026 at 2:11 pm

    two spelling issue:

    import android.view.View.OnClickListener; needs to change to : import android.view.View.OnKeyListener;

    ArayAdapter needs to change to ArrayAdapter

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good evening, I am working on a program where some application config info is
Good evening, I made a well working function with php, mysql and ajax. A
Good evening everyone. I am currently using MVC 3 and I have a viewmodel
Good morning\evening everyone! i have a string in a format like 0x0SD30SV8GN48N84GN wich represent
Good evening everyone, before explaining my problem, I should give you some explanation on
Good evening. Can You help me please with some batch file? I have an
Good evening everyone! I am having a bit of a problem and need some
Good evening, everyone. I've now run into an odd warning, and for the life
Good evening everyone, I have a quick question on a homework assignment my class
Good evening everyone, I was hoping you could help with an Objective-C question I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.