今天我的 G. Analytics 帐户在这行代码上报告了一个错误
private class GetSubscriptionListTask extends AsyncTask<Void, Void, Void> {
boolean onlyUnread=true;
public GetSubscriptionListTask(boolean onlyUnread) {
super();
this.onlyUnread=onlyUnread;
}
ProgressDialog progress;
@Override
protected void onPreExecute() {
//Show progress Dialog here
super.onPreExecute();
// create ProgressDialog here ...
progress = new ProgressDialog(getActivity()); // <-- That's the line
progress.setMessage("Downloading Subscriptions");
// set other progressbar attributes
progress.setCancelable (false);
progress.setIndeterminate (true);
progress.show();
}
}
这是行
progress = new ProgressDialog(getActivity()); // <-- That's the line
这是错误报告
NullPointerException (@SubscriptionsListFragment$GetSubscriptionListTask:onPreExecute:415) {main}
这是什么意思?nullexception 是关于 ProgressDialog 还是 getActivity()?
*更新* * 此错误仅在 100 多个会话中发生一次。