0

I have two different activities :

one having department list and another activity having employee list.

I want to add search functionality to my app such that it can search data for all activities from a single activity.
Please suggest if it is possible and how ?

For code you can refer How to pass data collected in arraylist from json asset file in one activity having recyclerview to another activity again having recycler view?

Community
  • 1
  • 1
Guneet Kaur
  • 544
  • 1
  • 8
  • 26
  • 2
    have you tried anything ? if so please post the sample of your code – KishanCS Mar 23 '17 at 05:06
  • @KishanCS : You can refer this http://stackoverflow.com/questions/42903982/how-to-pass-data-collected-in-arraylist-from-json-asset-file-in-one-activity-hav/42904041#42904041 for the code. I added addtextlistener method. – Guneet Kaur Mar 23 '17 at 05:08
  • Implement search in base activity and extends your all activities with that base activity. – Piyush Mar 23 '17 at 05:10
  • @Piyush : can you give me the example acc to the code in this :http://stackoverflow.com/questions/42903982/how-to-pass-data-collected-in-arraylist-from-json-asset-file-in-one-activity-hav/42904041#42904041 ? – Guneet Kaur Mar 23 '17 at 05:12
  • So, the search will be in another activity or fragment, right? What you need is, to implement logic for search the query inside different available models and display the result lists (of different models) inside a single search result list. – Nizam Mar 23 '17 at 05:13
  • 1
    @Nizam : not exactly! I want that if i have activity A and activity B : then when i use search in activity A , it should also show the content of activity B alongwith activity A. – Guneet Kaur Mar 23 '17 at 05:16
  • 1
    Possible duplicate of [How do I pass data between Activities in Android application?](http://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android-application) – Manoj Perumarath Mar 23 '17 at 05:28

1 Answers1

2

That means you need to search data of all Activity in single Activity.

So you need to add include conman SerchView in xml file of all Activities. Also Implement BaseActivity that holds search Implementation for all of your Acclivities.

Chetan Joshi
  • 5,582
  • 4
  • 30
  • 43