I have a MainActivity that has 4 buttons, when the user selects one of them, the button method calls another Activity , which will display a query in an XML in a ListView of this new Activity . I'm doing this:
Method% of new Activity :
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.refeicaoview);
lstDados = (ListView)findViewById(R.id.lstDados);
adpItens = new ArrayAdapter<String>(this, R.layout.item_lista);
lstDados.setAdapter(adpItens);
iniciaBusca(); //este método faz a consulta ao XML e retorna os dados para serem exibidos na listView acima
}
What I realize is that this way, when you click the button in MainActivity , it takes a while to create the new Activity , so I imagine running% first, load the listView and then display the screen.
What I want is for the screen to be created, and this onCreate
method then starts and while it runs, a progressDialog appears in the user interface.
Does anyone have a tip? Solution? : D
I have. ;)