I am developing an android application in which I have passed a string from one activity to another activity, after getting it from a edit text box by clicking on "OK" button.The string is a url which gives a rss feed.So it takes a little bit time to load it .I want to show a progress bar to keep the interface interactive.How can achieve a progress bar or a progress dialog on that same button click?
My code Snippet for activity is
EditText Urlis=(EditText)findViewById(R.id.entry);
final Button button = (Button) findViewById(R.id.ok);
final Intent i=new Intent(this , RSSReder.class);
final String choice=Urlis.getText().toString();
i.putExtra("key", choice);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(i);
}
});
}
}
some part of the code of next activity is
public class RSSReder extends Activity implements OnItemClickListener {
public String RSSFEEDOFCHOICE;
public final String tag = "RSSReader";
private RSSFed feed = null;
/** Called when the activity is first created. */
public void onCreate(Bundle abc) {
super.onCreate(abc);
setContentView(R.layout.next1);
Intent i = getIntent();
RSSFEEDOFCHOICE =i.getStringExtra("key");
// go get our feed!
feed = getFeed(RSSFEEDOFCHOICE);
// display UI
UpdateDisplay();
}