活动没有开始

时间:2012-05-01 03:47:48

标签: android

我可以让进度对话框停止,但TabbedView活动永远不会启动,只是进入黑屏。有什么想法吗?

    class DownloadWebPageTask extends AsyncTask<String, Void, String> {
    private final ProgressDialog dialog = new ProgressDialog(MainScreen.this);
     @Override
        protected void onPreExecute() {
            dialog.setMessage("Gathering data for\n"+selectedSportName+".\nPlease wait...");
            dialog.show();
        }


    @Override
    protected String doInBackground(String... urls) {
        String response = "";
        updateMaps();
        return response;
    }



    @Override
    protected void onPostExecute(String result) {
      dialog.dismiss();
      startTabbedViewActivity();
    }
}


private void startTabbedViewActivity(){
    Intent intent = new Intent(this, TabbedView.class);
    intent.putExtra(SPORT_NAME_EXTRA, selectedSportName);
    intent.putExtra(HEADLINES_FOR_SPORT_EXTRA,         existingSportHeadlines.get(selectedSportName));
    intent.putExtra(SCORES_FOR_SPORT_EXTRA, existingSportScores.get(selectedSportName));
    intent.putExtra(SCHEDULE_FOR_SPORT_EXTRA, existingSportSchedule.get(selectedSportName));
    startActivity(intent);
}

我查看了Manifest文件,我没有看到任何奇怪的样子。无法想出这个。

2 个答案:

答案 0 :(得分:0)

活动的布局是否正确定位

 android:orientation="vertical"

答案 1 :(得分:0)

您忘记在'onPostExecute'方法上方添加@Override,因此根本不会执行。