I need to show activity with MapView, if user long clicked on the list item. This process takes a while, so I would like to show user progressdialog, while application hangs. Here is the code:
ListView listView = (ListView) findViewById(android.R.id.list);
listView.setOnItemLongClickListener (new OnItemLongClickListener() {
public boolean onItemLongClick(AdapterView parent, View view, int position, long id) {
...
ProgressDialog dialog = ProgressDialog.show(getApplicationContext(), "", "Loading. Please wait...", true);
Intent intent = new Intent(getBaseContext(), Map.class);
startActivity(intent);
Have I chosen correct approach? Getting different FCs now (depending on the context chosen for ProgressDialog). Can ProgressBar be shown in my scenario?
Upd. I've tried to show Toast before starting activity. Again, Toast is shown only when Map is already displayed. Don't understand what happens. If I remove startActivity code, then Toast is displayed immediately.