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

The Archive Base Latest Questions

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

My search box is not displaying when I press the search button on my

  • 0

My search box is not displaying when I press the search button on my Android phone. What I want to do is do an ASyncTask (or background task) to get a JSON response of an array of strings (names of people), search through the result, and display it to the user using the same search functionality that IMDB has. Currently, I’m using a string array to test my search response/request. Any ideas?

I get the following warnings when pressing the search button (but I think this is unrelated to my issue):

04-21 03:35:23.767: WARN/KeyCharacterMap(12946): Can't open keycharmap file
04-21 03:36:48.978: WARN/KeyCharacterMap(12999): Error loading keycharmap file '/system/usr/keychars/qtouch-touchscreen.kcm.bin'. hw.keyboards.65537.devname='qtouch-touchscreen'
04-21 03:37:21.408: WARN/KeyCharacterMap(2576): Using default keymap: /system/usr/keychars/qwerty.kcm.bin

The error below has been fixed courtesy of @Heiko Rupp:

04-21 03:17:51.994: WARN/SearchableInfo(1293): Invalid searchable metadata for com.redacted/.SearchActivity: Search label must be a resource reference.

SearchActivity.java:

package com.redacted;

import android.app.ListActivity;
import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ArrayAdapter;

public class SearchActivity extends ListActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.search_results);
        handleIntent(getIntent());
    }

    @Override
    protected void onNewIntent(Intent intent) {
        setIntent(intent);
        handleIntent(intent);
    }

    private void handleIntent(Intent intent) {
        if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
            String query = intent.getStringExtra(SearchManager.QUERY);
            showResults(query);
        }
    }

    private void showResults(String q) {
        String[] listItems = { "test", "my", "search", "list" };

        setListAdapter(new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, listItems));
    }
}

searchable.xml:

<?xml version="1.0" encoding="utf-8"?>
<searchable
  xmlns:android="http://schemas.android.com/apk/res/android" 
  android:searchButtonText="Search" 
  android:label="Redacted" 
  android:hint="Redacted"
  android:voiceSearchMode="showVoiceSearchButton|launchRecognizer">
</searchable>

Part of Manifest Manifest.xml (meta-data is inside tag so it’s global):

<activity android:launchMode="singleTop" android:name="SearchActivity">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>
            <meta-data android:name="android.app.searchable" 
                android:resource="@xml/searchable"/>
        </activity>
        <meta-data android:name="android.app.default_searchable"
            android:value="SearchActivity" />
    </application>

search_results.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent">
    <ListView android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/list"></ListView>
</LinearLayout>
  • 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-21T17:26:03+00:00Added an answer on May 21, 2026 at 5:26 pm

    I got in to the same problem.The value for android:label must be a string resource.Hardcoding strings won’t wok.

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

Sidebar

Related Questions

I have a search box and search button. I want to call a javascript
I have a search box that doesn't have a submit button, I need to
I'm implementing global search box extension (sth like SearchableDictionary sample in android sdk). Everything
Greetings, In my current project, I have gridview, search button, text box for search,
In the example below, the alert dialog box is not displaying at all. Any
I want to simulate the Google Search effect that even with the search box
Why does the search box here not have 15px padding to the right? This
I'm having trouble performing a search operation in the background, and displaying the results
I'm implementing a search box using CodeIgniter, but I'm not sure about how I
I want to change the look of search box. In stackoverlow, as you can

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.