i am navigating to members list Activity from drawer menu, here i need search view and back arrow button. when user clicks on search icon i want to expand it after completion of work he will navigate to back using arrow button. how to achieve this.
try this
1. create a search_layout like this
<?xml version="1.0" encoding="utf-8"?>
<EditText xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/searchfield"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/custom_search_edit"
android:hint="@string/search_hint"
android:inputType="textFilter"
android:textColor="@color/colorBlack"
android:textColorHint="@color/colorAccent"
android:textSize="15sp" />
2. add this code in your activity
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setCustomView(R.layout.search_layout);
EditText search = (EditText) getSupportActionBar().getCustomView().
findViewById(R.id.searchfield);
search.setOnEditorActionListener(new EditText.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId,
KeyEvent event) {
return true;
}
});
getSupportActionBar().setDisplayOptions(getSupportActionBar().DISPLAY_SHOW_CUSTOM
| getSupportActionBar().DISPLAY_SHOW_HOME);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
or you can use Searchview
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I'm trying to print the Euro currency character in a Bixolon SPP-R200III'm using the last sdk for android from Bixolon web
I think I am missing something here, I'll explain what I need to doWe are planning the move to Git, we currently use something else
I am trying to write a middleware using node js and expressIf user is not authenticated it will redirect him to login page
I have an angular js service which returns a node js WebSocket connection