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

  • Home
  • SEARCH
  • 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 1031105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T13:52:34+00:00 2026-05-16T13:52:34+00:00

When I click on a menu item I am presented with the following message

  • 0

When I click on a menu item I am presented with the following message in DDMS:

Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43882778

Here is most of the code from the Main class where the onMenuClick is being ignored.


public class Main extends TabActivity {

 public static final int ACTIVITY_CREATE = 0;

 private static final int ADD_ID = Menu.FIRST;

 private Long listId;
 private DbHelper mDbHelper;
 private Cursor mCursor;

 /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        // Set the list id
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
         listId = extras.getLong("listId");
        }

        // Open the database
        mDbHelper = new DbHelper(this);
        mDbHelper.open();

        // Setup the tabs
        createTabs();
    }

    public void createTabs() {
     mCursor = mDbHelper.fetchAllCategories(listId);
     startManagingCursor(mCursor);

     for (int i = 0; i [less than symbol] mCursor.getCount(); i++)
     {
      createTab(
    mCursor.getLong(mCursor.getColumnIndexOrThrow("_id")),
    mCursor.getString(mCursor.getColumnIndexOrThrow("category")));
     }
    }

    public void createTab(Long categoryId, String category) {
        TabHost tabHost = getTabHost();
        TabHost.TabSpec spec;
        Intent intent;

        intent = new Intent();
      intent.putExtra("Test", category);
      intent.setClass(this, Categories.class);
  spec = tabHost.newTabSpec(category);
   spec.setContent(intent);
   spec.setIndicator(category);
  tabHost.addTab(spec);     
    }

 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
  super.onCreateOptionsMenu(menu);
  menu.add(0, ADD_ID, 0, R.string.menu_addCategory).setIcon(R.drawable.add_grey);
  return true;
 }

 @Override
 public boolean onMenuItemSelected(int featureId, MenuItem item) {
  switch (item.getItemId()) {
  case ADD_ID:
   addCategory();
   return true;
  }

  return super.onMenuItemSelected(featureId, item);
 }

 public void addCategory() {
  Intent intent = new Intent();
  intent.setClass(this, CategoryEdit.class);
  startActivityForResult(intent, ACTIVITY_CREATE);
 }

 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
  super.onActivityResult(requestCode, resultCode, intent);

  switch (requestCode) {
  case ACTIVITY_CREATE:
   if (resultCode == RESULT_OK) {
    Bundle createExtras = intent.getExtras();
    mDbHelper.addCategory(createExtras.getString("category"));

   }
  }
 }
}

Originally my CategoryEdit.class wasn’t listed in the AndroidManifest.xml file. I have added that to the manifest and still receive the same error.

  • 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-16T13:52:35+00:00Added an answer on May 16, 2026 at 1:52 pm

    use ::

    public boolean onOptionsItemSelected(MenuItem item) {
    

    instead of::

     public boolean onMenuItemSelected(int featureId, MenuItem item) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem related to WebKit: http://demo.frojd.se/webkit/index.html When you click Menu item 1
I learned how to add an item to the right-click context menu, but I
How to show a Context Menu when you right click a Menu Item in
I am looking to add a new item in a right click context menu
I am trying to make a notification message appear when I click the menu
I'm calling startActivityForResult() once on a menu item click, but the intent is being
What's the easiest/best way to register your program in explorers right-click menu using .NET
Is it possible, using actionscript 3 to disable the right click menu? Any help
I want to create a right click context menu for my textboxes to provide
In my cross-platform architecture, I would like to act on a context menu click

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.