<commit_before>package com.spiddekauga.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;

import com.spiddekauga.android.feedback.FeedbackRepo;

/**
 * Base class for Android Activities
 */
public abstract class AppActivity extends AppCompatActivity {
static private AppActivity mActivity = null;
private static boolean mFirstTime = true;

/**
 * Exit the application
 */
public static void exit() {
	if (mActivity != null) {
		Intent intent = new Intent(Intent.ACTION_MAIN);
		intent.addCategory(Intent.CATEGORY_HOME);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		mActivity.startActivity(intent);
	}
}

/**
 * @return the context for this app
 */
public static AppActivity getActivity() {
	return mActivity;<commit_msg>Fix bug where AppActivity.getActivity() is null the first time the first time the activity is created<commit_after>package com.spiddekauga.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;

import com.spiddekauga.android.feedback.FeedbackRepo;

/**
 * Base class for Android Activities
 */
public abstract class AppActivity extends AppCompatActivity {
static private AppActivity mActivity = null;
private static boolean mFirstTime = true;

/**
 * Default constructor
 */
public AppActivity() {
	// Set the activity first time it's created
	if (mActivity == null) {
		mActivity = this;
	}
}

/**
 * Exit the application
 */
public static void exit() {
	if (mActivity != null) {
		Intent intent = new Intent(Intent.ACTION_MAIN);
		intent.addCategory(Intent.CATEGORY_HOME);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		mActivity.startActivity(intent);
	}
}

/**
 * @return the context for this app
 */
public static AppActivity getActivity() {
	return mActivity;
{'fraction_non_alphanumeric': 0.10101010101010101, 'fraction_numerical': 0.001924001924001924, 'mean_word_length': 5.0641399416909625, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3871677', 'n_tokens_mistral': 633, 'n_tokens_neox': 619, 'n_words': 166}