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 6655651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:32:46+00:00 2026-05-26T01:32:46+00:00

i have made menu list containing play, settings, exit. but clicking the button doesn

  • 0

i have made menu list containing play, settings, exit. but clicking the button doesn take me to the desired activity the listner is not working..can any one help me solve the problem.. will b thankfull..
yes its a list view control..

there are two errors in my code one is that
@@ The type new AdapterView.OnItemClickListener(){} must implement the inherited abstract method AdapterView.OnItemClickListener.onItemClick(AdapterView, View, int, long)@@ in LINE1

And the other one is @@ View cannot be resolved to a type@@ in LINE 2
“Actually i want to shift from one screen to another when i click on the item in main menu screen”

Here is the code of main menu

public class MenuActivity extends Activity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu);
        ListView menuList = (ListView) findViewById(R.id.list);
        String[] items = {
            getResources().getString(R.string.pla),
            getResources().getString(R.string.sco),
            getResources().getString(R.string.set),
            getResources().getString(R.string.hel),
            getResources().getString(R.string.qui)
        };
        ArrayAdapter < String > adapt = new ArrayAdapter < String > (this, R.layout.menu_items, items);
        menuList.setAdapter(adapt);
        menuList.setOnItemClickListener(new AdapterView.OnItemClickListener() { //LINE 1 error 
            public void onItemClick(AdapterView <? > parent, View itemClicked, //LINE 2 error
                int position, long id) {
                TextView textView = (TextView) itemClicked;
                String strText = textView.getText().toString();
                if (strText.equalsIgnoreCase(getResources().getString(
                    R.string.pla))) {
                    // Game
                    startActivity(new Intent(MenuActivity.this,
                        GameActivity.class));
                } else if (strText.equalsIgnoreCase(getResources().getString(
                    R.string.hel))) {
                    // Help
                    startActivity(new Intent(MenuActivity.this,
                        HelpActivity.class));
                } else if (strText.equalsIgnoreCase(getResources().getString(
                    R.string.set))) {
                    //Settings 
                    startActivity(new Intent(MenuActivity.this,
                        SettingsActivity.class));
                } else if (strText.equalsIgnoreCase(getResources().getString(
                    R.string.sco))) {
                    //  Scores 
                    startActivity(new Intent(MenuActivity.this,
                        ScoresActivity.class));
                }
            }
        });
    }
}
  • 1 1 Answer
  • 0 Views
  • 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-26T01:32:47+00:00Added an answer on May 26, 2026 at 1:32 am
    ListView lv = ...;
    lv.setOnItemClickListener(new OnItemClickListener() {
    public void onItemClick(AdapterView<?> arg0,View arg1, int arg2, long arg3) 
    {
      //Do Your Stuff
    }
    });
    

    or you can make your custom adapter and write the button’s click event

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

Sidebar

Related Questions

I have made an options menu attached to my android menu button, but how
I have a horizontal menu bar made up of <li> tags, containing links, so
I have a menu made of an li list. Each li item needs to
I have made a drop down menu which is working fine, but when i
i have made a few multi activity database applications using sqlite, but i get
I have dropdown menu and its made via a list and position absolute, however
I have a drop down menu made with Jquery. Right now, if you hover
I have a vertical menu in my system which is basically made of HTML
I have a class containing, among other things, a drop down menu. With the
I have a menu made with HTML, using a simple UL with lots of

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.