Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

customize the androidx.appcompat.widget.SearchView site:stackoverflow.com

SearchView mSearchView = (SearchView)menu.findItem(R.id.search).getActionView();
    try
    {
        Field searchField = SearchView.class.getDeclaredField("mSearchButton");
        searchField.setAccessible(true);
        ImageView searchBtn = (ImageView)searchField.get(mSearchView);
        searchBtn.setImageResource(R.drawable.search_img);
        searchField = SearchView.class.getDeclaredField("mSearchPlate");
        searchField.setAccessible(true);
        LinearLayout searchPlate = (LinearLayout)searchField.get(mSearchView);
        ((ImageView)searchPlate.getChildAt(0)).setImageResource(R.drawable.search_img);
        searchPlate.setBackgroundResource(R.drawable.edit_text_bkg);
    }
    catch (NoSuchFieldException e)
    {
        Log.e(TAG,e.getMessage(),e);
    }
    catch (IllegalAccessException e)
    {
        Log.e(TAG,e.getMessage(),e);
    }
Comment

PREVIOUS NEXT
Code Example
Java :: give text color and font size in android string 
Java :: how to print multi dimension array in java using for each loop 
Java :: spring boot return 201 created 
Java :: stack push java 
Java :: integer to roman 
Java :: sort stream by key java 
Java :: Converting data in java 
Java :: Java lAccess TreeMap Elements 
Java :: google pass api integration in java 
Java :: OpenCV mat to float bytebuffer java 
Java :: boolean parse jtextfield 
Java :: How to set the java.library.path from Eclipse 
Java :: Pre Render View 
Java :: split string in / java 
Java :: expiry time of otp android 
Java :: java schleife abbrechen 
Java :: java skip foreach 
Java :: java unfocus 
Java :: how to search element in jtablejava 
Java :: produces 
Java :: spigot item break 
Java :: Buscando Objeto do Array 
Java :: httpsession vs cookie servlet 
Java :: get historical data from the past to the present yahoo finance api 
Java :: java param.ExStyle |= 0x08000000; 
Java :: what is a literal in java 
Java :: Duplicate entry Exception 
Java :: code to determine distance and time in java 
Java :: array erstellen java 
Java :: java output formatting 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =