<commit_before>package com.czbix.v2ex.ui;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.czbix.v2ex.AppCtx;
import com.czbix.v2ex.eventbus.BaseEvent;
import com.google.common.eventbus.Subscribe;

@SuppressLint("Registered")
public class BaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        final Wrapper wrapper = new Wrapper();
        AppCtx.getEventBus().register(wrapper);

        if (AppCtx.getInstance().isInited()) {
            AppCtx.getEventBus().unregister(wrapper);
            return;
        }

        startActivityForResult(new Intent(this, LoadingActivity.class), 0);
    }

    private class Wrapper {
        @Subscribe
        public void onContextInitFinishEvent(BaseEvent.ContextInitFinishEvent e) {
            AppCtx.getEventBus().unregister(this);

            finishActivity(0);<commit_msg>refine code<commit_after>package com.czbix.v2ex.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.czbix.v2ex.AppCtx;
import com.czbix.v2ex.eventbus.BaseEvent;
import com.google.common.eventbus.Subscribe;

public abstract class BaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        final Wrapper wrapper = new Wrapper();
        AppCtx.getEventBus().register(wrapper);

        if (AppCtx.getInstance().isInited()) {
            AppCtx.getEventBus().unregister(wrapper);
            return;
        }

        startActivityForResult(new Intent(this, LoadingActivity.class), 0);
    }

    private class Wrapper {
        @Subscribe
        public void onContextInitFinishEvent(BaseEvent.ContextInitFinishEvent e) {
            AppCtx.getEventBus().unregister(this);

            finishActivity(0);
{'fraction_non_alphanumeric': 0.09797130133597229, 'fraction_numerical': 0.005937654626422563, 'mean_word_length': 3.4148471615720526, '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': '7553606', 'n_tokens_mistral': 583, 'n_tokens_neox': 572, 'n_words': 102}