1
我使用異步任務顯示進度對話框。本地化進度對話框
private class RetrieveTask extends AsyncTask<String, Void, String>
{
RetrieveTask t = this;
ProgressDialog d = null;
@Override
protected void onPreExecute()
{
// TODO
//d = ProgressDialog.show(context, "", context.getString(R.string.querying_server), true, true, new DialogInterface.OnCancelListener() {
d = ProgressDialog.show(context, "", "Loading...", true, true, new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
t.cancel(true);
}
});
// continues....
通過這一階段context
已被設置爲根活動。
我想按照「TODO」後面的註釋中的說明對本消息進行本地化。爲此,我需要獲取字符串資源;我如何從這裏最好地做到這一點?
謝謝。然而,這項任務不是在它意識到的活動中進行的。 – SK9 2012-01-29 08:40:55