<commit_before>package com.frinder.frinder.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;

import com.frinder.frinder.R;
import com.frinder.frinder.dataaccess.MessageFirebaseDas;
import com.frinder.frinder.model.MessageThread;
import com.frinder.frinder.utils.Constants;
import com.frinder.frinder.views.ThreadDialogViewHolder;
import com.stfalcon.chatkit.dialogs.DialogsList;
import com.stfalcon.chatkit.dialogs.DialogsListAdapter;

import org.parceler.Parcels;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MessagesListActivity extends BaseActivity {

    private MessageFirebaseDas mMessageFirebaseDas;

    @BindView(R.id.dlThreads)
    DialogsList dlThreads;
    @BindView(R.id.toolbar)
    Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_messages_list);
        ButterKnife.bind(this);

        setSupportActionBar(toolbar);
        getSupportActionBar().setTitle("Messages");

        final DialogsListAdapter dialogsListAdapter =
                new DialogsListAdapter<>(R.layout.item_dialog, ThreadDialogViewHolder.class, null);
        dialogsListAdapter.setOnDialogClickListener(new DialogsListAdapter.OnDialogClickListener<MessageThread>() {
            @Override
            public void onDialogClick(MessageThread thread) {
                Intent i = new Intent(MessagesListActivity.this, MessageDetailActivity.class);
                i.putExtra(Constants.INTENT_EXTRA_THREAD, Parcels.wrap(thread));
                MessagesListActivity.this.startActivity(i);
            }
        });
        
        dlThreads.setAdapter(dialogsListAdapter);
        mMessageFirebaseDas = new MessageFirebaseDas(this);
        mMessageFirebaseDas.getThreads(new MessageFirebaseDas.OnCompletionListener() {
            public void onThreadsReceived(ArrayList<MessageThread> threads) {
                dialogsListAdapter.setItems(threads);
                dialogsListAdapter.notifyDataSetChanged();
            }
        });
    }
}<commit_msg>Move thread reload to onResume<commit_after>package com.frinder.frinder.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;

import com.frinder.frinder.R;
import com.frinder.frinder.dataaccess.MessageFirebaseDas;
import com.frinder.frinder.model.MessageThread;
import com.frinder.frinder.utils.Constants;
import com.frinder.frinder.views.ThreadDialogViewHolder;
import com.stfalcon.chatkit.dialogs.DialogsList;
import com.stfalcon.chatkit.dialogs.DialogsListAdapter;

import org.parceler.Parcels;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MessagesListActivity extends BaseActivity {

    private MessageFirebaseDas mMessageFirebaseDas;
    private DialogsListAdapter mAdapter;

    @BindView(R.id.dlThreads)
    DialogsList dlThreads;
    @BindView(R.id.toolbar)
    Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_messages_list);
        ButterKnife.bind(this);

        setSupportActionBar(toolbar);
        getSupportActionBar().setTitle("Messages");

        mAdapter = new DialogsListAdapter<>(R.layout.item_dialog, ThreadDialogViewHolder.class, null);
        mAdapter.setOnDialogClickListener(new DialogsListAdapter.OnDialogClickListener<MessageThread>() {
            @Override
            public void onDialogClick(MessageThread thread) {
                Intent i = new Intent(MessagesListActivity.this, MessageDetailActivity.class);
                i.putExtra(Constants.INTENT_EXTRA_THREAD, Parcels.wrap(thread));
                MessagesListActivity.this.startActivity(i);
            }
        });

        dlThreads.setAdapter(mAdapter);
        mMessageFirebaseDas = new MessageFirebaseDas(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        mMessageFirebaseDas.getThreads(new MessageFirebaseDas.OnCompletionListener() {
            public void onThreadsReceived(ArrayList<MessageThread> threads) {
                mAdapter.setItems(threads);
                mAdapter.notifyDataSetChanged();
            }
        });
    }
}
{'fraction_non_alphanumeric': 0.08601177003168854, 'fraction_numerical': 0.0004526935264825713, 'mean_word_length': 3.5698035160289554, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6649103', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1214, 'n_words': 186}