<commit_before>package com.crossbowffs.quotelock.app;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.crossbowffs.quotelock.R;
import com.crossbowffs.quotelock.model.VnaasQuote;

public class MainActivity extends Activity {
    private class ActivityQuoteDownloaderTask extends QuoteDownloaderTask {
        private ProgressDialog mDialog;

        private ActivityQuoteDownloaderTask() {
            super(MainActivity.this);
        }

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            mDialog = new ProgressDialog(MainActivity.this);
            mDialog.setMessage(getString(R.string.downloading_quote));
            mDialog.setIndeterminate(true);
            mDialog.show();
        }

        @Override
        protected void onPostExecute(VnaasQuote vnaasQuote) {
            super.onPostExecute(vnaasQuote);
            mDialog.dismiss();
        }

        @Override
        protected void onCancelled() {
            super.onCancelled();
            mDialog.dismiss();
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        getFragmentManager()
            .beginTransaction()
            .replace(R.id.content_frame, new SettingsFragment())
            .commit();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_options, menu);
        return super.onCreateOptionsMenu(menu);
    }
<commit_msg>Create task on activity start<commit_after>package com.crossbowffs.quotelock.app;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.crossbowffs.quotelock.R;
import com.crossbowffs.quotelock.model.VnaasQuote;
import com.crossbowffs.quotelock.utils.JobUtils;

public class MainActivity extends Activity {
    private class ActivityQuoteDownloaderTask extends QuoteDownloaderTask {
        private ProgressDialog mDialog;

        private ActivityQuoteDownloaderTask() {
            super(MainActivity.this);
        }

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            mDialog = new ProgressDialog(MainActivity.this);
            mDialog.setMessage(getString(R.string.downloading_quote));
            mDialog.setIndeterminate(true);
            mDialog.show();
        }

        @Override
        protected void onPostExecute(VnaasQuote vnaasQuote) {
            super.onPostExecute(vnaasQuote);
            mDialog.dismiss();
        }

        @Override
        protected void onCancelled() {
            super.onCancelled();
            mDialog.dismiss();
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        getFragmentManager()
            .beginTransaction()
            .replace(R.id.content_frame, new SettingsFragment())
            .commit();

        // In case the user opens the app for the first time *after* rebooting,
        // we want to make sure the background job has been created. This has the
        // side effect of resetting the time until the next refresh, but for most
        // users that won't be noticable.
        JobUtils.createQuoteDownloadJob(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_options, menu);
        return super.onCreateOptionsMenu(menu);
    }

{'fraction_non_alphanumeric': 0.08463708643241857, 'fraction_numerical': 0.0, 'mean_word_length': 2.5878564857405704, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7812', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1015, 'n_words': 218}