<commit_before>package interdroid.util.view;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;

public abstract class AsyncTaskWithProgressDialog<A, B, C> extends AsyncTask<A, B, C>{
	protected Activity mContext;

	private ProgressDialog mDialog;
	private String mTitle;
	private String mMessage;

	public AsyncTaskWithProgressDialog(Activity context, String title, String message) {
		mContext = context;
		mTitle = title;
		mMessage = message;
	}

	@Override
	protected void onPreExecute() {
		mDialog = ProgressDialog.show(mContext, mTitle, mMessage, true, false);
	}

	@Override
	protected void onPostExecute(C v) {
		mDialog.dismiss();
		mDialog = null;
	}
}<commit_msg>Only close dialog if it is still showing.<commit_after>package interdroid.util.view;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;

public abstract class AsyncTaskWithProgressDialog<A, B, C> extends AsyncTask<A, B, C>{
	protected Activity mContext;

	private ProgressDialog mDialog;
	private String mTitle;
	private String mMessage;

	public AsyncTaskWithProgressDialog(Activity context, String title, String message) {
		mContext = context;
		mTitle = title;
		mMessage = message;
	}

	@Override
	protected void onPreExecute() {
		mDialog = ProgressDialog.show(mContext, mTitle, mMessage, true, false);
	}

	@Override
	protected void onPostExecute(C v) {
		if (mDialog != null && mDialog.isShowing()) {
			mDialog.dismiss();
			mDialog = null;
		}
	}
}

{'fraction_non_alphanumeric': 0.09467455621301775, 'fraction_numerical': 0.0, 'mean_word_length': 5.112449799196787, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6538207', 'n_tokens_mistral': 489, 'n_tokens_neox': 461, 'n_words': 133}