You have to explore the life cycle of his Activity
using the onResume()
. You’d have to put your search back into the method.
@Override
public void onResume(){
super.onResume();
// coloque sua busca novamente aqui
}
Life cycle
As the user navigates, exits and returns to your application, the instances Activity
in the application transit between different states in the life cycle. For example, when the activity starts for the first time, it is in the foreground of the system and has the focus of the user.
During the process, the Android system calls a series of life cycle methods in the activity, where you define the user interface and other components. If the user executes an action that starts another activity or switches to another application, the system calls another set of life cycle methods in its activity as it gets in the background (where the activity is no longer visible, but the instance and its state remain intact).
Details
Call the notifyDataSetChanged() method from your Adapter whenever there are changes to the data. https://www.youtube.com/watch?v=wDBM6wVEO70&t=17m38s
– Reginaldo Rigo
thank you so much for this problem I managed to solve, but another one came up if you can help me I thank you ! http://answall.com/questions/154431/manter-os-dados-em-uma-variavel-da-primeira-act-apos-voltar-da-segunda-act-pelo
– Vitor Hugo