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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:07:45+00:00 2026-05-24T13:07:45+00:00

I searched other post like this, but I didn’t find a solution. Anyone know

  • 0

I searched other post like this, but I didn’t find a solution.
Anyone know why I’m getting this message when I select the Preferences form the menu:

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

The activity is declared in the manifest file.

import com.cartrafficlive.R;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;

public class ShowMap extends MapActivity{

    static final private int MENU_PREFERENCES = Menu.FIRST;
    private static final int SHOW_PREFERENCES = 1;

    MapController mapController;

    String depAdd;
    String arrAdd;

    @Override
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.show_map);

        MapView myMapView = (MapView)findViewById(R.id.myMapView);
        mapController = myMapView.getController();

        myMapView.setSatellite(true);
        myMapView.setStreetView(true);
        myMapView.displayZoomControls(true);

        mapController.setZoom(17);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu){
        super.onCreateOptionsMenu(menu);

        menu.add(0, MENU_PREFERENCES, Menu.NONE, R.string.menu_preferences);

        return true;
    }

    public boolean onOptionItemSelected(MenuItem item){
        super.onOptionsItemSelected(item);

        switch(item.getItemId()){
            case(MENU_PREFERENCES): {
                Intent i = new Intent(this, Preferences.class);
                startActivityForResult(i, SHOW_PREFERENCES);

                return true;
            }
        }
        return false;
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);

      if (requestCode == SHOW_PREFERENCES)
        if (resultCode == Activity.RESULT_OK) {
          updateFromPreferences();
        } 
    }

    private void updateFromPreferences() {
        Context context = getApplicationContext();
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

        depAdd = prefs.getString(Preferences.PREF_DEP_ADD, "null");
        arrAdd = prefs.getString(Preferences.PREF_ARR_ADD, "null");
    }

    @Override
    protected boolean isRouteDisplayed() {
        return false;
    }

}
  • 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-24T13:07:46+00:00Added an answer on May 24, 2026 at 1:07 pm

    I solve with this line of code:

    menu.addIntentOptions(Menu.NONE, Menu.NONE, Menu.NONE, this.getComponentName(), null, i, Menu.NONE, null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I searched and found this question but did not like the answer. Is there
I searched google but couldn't find an answer to this rather simple question. I
I searched about this in SO and dint find a post on this. Since
I have searched about all the post but I can't found the solution on
I searched for this and found Maudite's question about text editors but they were
I searched the web, but I find a bunch of very different diagrams. Most
I have searched the forums and did not find any post relevant to my
I've searched over this topic but found very few details which were helpful. With
I searched through this site to find out how to rotate a image back
The question is in the title... I searched but couldn't find anything. Edit: 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.