Is it possible to implement a searchview widget to search from textview. My textview looks like this
TextView TextView TextView
and I inflate these 3 textviews using layout inflater to show multiple values from a fragment.
Fragment Class
public class MainFragment extends Fragment {
public View onCreateView (LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// set the layout and inflater
//perform some operations for button click
return view;
}
Activity class
public class MainActivity extends FragmentActivity{
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new MainFragment()).commit();
}
}
public boolean onOptionsItemSelected(MenuItem item) {
//do some operations with overflow menu
}
public ArrayList<Asset> getData() {
//perform operations so that data can be sorted to an array and then passed to textviews
}
I am confused as to where to include the searchview widget and how to make the textview searchable..