0
我正在開發一個android應用程序,其中我從一個活動傳遞給另一個活動的字符串,從編輯文本框中通過單擊「確定」按鈕獲取它。字符串是一個url,它提供了一個rss feed.So加載它需要一點時間。我想顯示一個進度條來保持界面的交互性。如何在同一個按鈕上點擊一個進度條或進度對話框?如何在按鈕單擊時獲取進度條?
我的活動代碼段是
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);
}
});
}
}
下一個活動的代碼的某些部分是
公共類RSSReder擴展活動實現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();
}
你是否顯示使用來自以前的活動在新類(RSSReader.class)中的url的webview ...? – 2011-06-01 07:16:14
Dinesh我在列表視圖中獲取新活動中的RSS源 – 2011-06-01 07:22:08
你能發佈一些新的活動的代碼,你實際上在那裏做什麼......? – 2011-06-01 07:25:31