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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:31:10+00:00 2026-05-26T17:31:10+00:00

I have a Map activity in a fairly complex layout. As such, I can’t

  • 0

I have a Map activity in a fairly complex layout. As such, I can’t simple search using the map’s search function in that activity without making a bad window (and crashing the app, I would need onSearchRequested to use a different context, but it doesn’t accept parameters.)

What I have done is made another transparent popup activity above the map activity which immediately calls onSearchRequested() during onCreate()

the thing is that when I type in something and click search, nothing happens. The search bar just clears itself but stays on screen as if prompting me to search for something again. I dont know what happens to this search query but I need it passed to my MapActivity.

I was considering doing startActivityforResult and passing a result back from the search popup activity, but I still have the dilemma of not knowing how to store the result and making search go away after clicking search

This class loads up a search box, thats all. It also has a transparent imageview in the space between the search box and keyboard. If a user clicks there, the activity is finished()

public class PseudoMapSearchActivity extends Activity {

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

    onSearchRequested();

    findViewById(R.id.blankness).setOnClickListener(new OnClickListener(){

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            finish();
        }

    });

    final SearchManager searchManager =
            (SearchManager) getSystemService(this.SEARCH_SERVICE);

    searchManager.setOnCancelListener(new SearchManager.OnCancelListener() {
          public void onCancel() {
              searchManager.setOnCancelListener(null);
              searchManager.stopSearch();
              finish();
          }
      });

    searchManager.setOnDismissListener(new SearchManager.OnDismissListener() {
          public void onDismiss() {
              searchManager.setOnCancelListener(null);
              searchManager.stopSearch();
              finish();
          }
      });

    //searchManager.getSearchableInfo(getCallingActivity());

    //searchManager.triggerSearch(query, launchActivity, appSearchData)

}

what searchManager function should I call to get the user typed and selected search query out of it

    <activity android:name=".PseudoMapSearchActivity" android:theme="@style/Theme.Transparent" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
        <meta-data android:name="android.app.default_searchable"
            android:value=".PseudoMapSearchActivity" />
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
            android:resource="@xml/searchable" />
    </activity>

Since the Pseudomapsearch popup activity won’t be doing the actual searching, and my activity with the map will be doing all the actual processing of this location data, should I then change the manifest somehow?

  • 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-26T17:31:10+00:00Added an answer on May 26, 2026 at 5:31 pm

    You could store your result from an startActivityForResult in an Android SharedPreferences object. SharedPreferences are awesome, and can be gotten from anywhere in the application, or even globally. It is a good idea to have a class to store constants for SharedPreferences in, if you don’t have one.
    The documentation for SharedPreferences is great. Here is the link:

    http://developer.android.com/reference/android/content/SharedPreferences.html

    Hope this helps!

    As for getting the data from the result, you need to use the method called onActivityResult. Then use the appropriate request code.
    The documentation for the mentioned method can be found here:

    http://developer.android.com/reference/android/app/Activity.html

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

Sidebar

Related Questions

I have an Android activity that displays a list of log entries (using a
I have a map view activity that shows a few OverlayItems . In the
Hello i have a simple expandable list activity that was working fine until i
I have a map for my game, I have a script that on a
I have a map that represents a DB object. I want to get 'well
I have an @activity that has_many :clientships When creating a new object I assign
I have a parent class in Android that inherits from Activity and all my
I have create the list-activity.Now I want to add new view with with map
Friends i am making an application in which i am using Map Activity. Now
I have a TabActivity that is the base Activity in my application. From the

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.