<commit_before>package com.example.android.androidsimulator.activities;

import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;

import com.example.android.androidsimulator.data.Messages;
import com.example.android.androidsimulator.adapters.MessagesAdapter;
import com.example.android.androidsimulator.R;

import java.util.ArrayList;

public class MessagesActivity extends AppCompatActivity {

    SharedPreferences preferences;

    ArrayList<Messages> messages;
    MessagesAdapter messagesAdapter;
    Button newMessage_button;

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

        newMessage_button = (Button) findViewById(R.id.newMessage_button);

        newMessage_button.setOnClickListener(new View.OnClickListener(){
           @Override
            public void onClick(View v) {
               // open the Activity SelectedMessageContact to create a new message
               Intent intent = new Intent(MessagesActivity.this, SelectedMessageContact.class);
               intent.putExtra("selectedContact", 0);
               startActivity(intent);
           }
        });

        showListMessages();
    }

    @Override
    protected void onResume() {
        super.onResume();

        // update list
        showListMessages();
    }

    private void showListMessages() {
        messages = new ArrayList<>();
        preferences = PreferenceManager.getDefaultSharedPreferences(this);

        int totalContacts = preferences.getInt("totalContacts", 0);

        for (int index = 1; index <= totalContacts; index++) {
            int totalMessages = preferences.getInt("totalMessages" + index, 0);
<commit_msg>Now is possible to open a conversation<commit_after>package com.example.android.androidsimulator.activities;

import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;

import com.example.android.androidsimulator.data.Messages;
import com.example.android.androidsimulator.adapters.MessagesAdapter;
import com.example.android.androidsimulator.R;

import java.util.ArrayList;

public class MessagesActivity extends AppCompatActivity {

    SharedPreferences preferences;

    ArrayList<Messages> messages;
    MessagesAdapter messagesAdapter;
    Button newMessage_button;

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

        preferences = PreferenceManager.getDefaultSharedPreferences(this);

        newMessage_button = (Button) findViewById(R.id.newMessage_button);

        newMessage_button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // open the Activity SelectedMessageContact to create a new message
                Intent intent = new Intent(MessagesActivity.this, SelectedMessageContact.class);
                intent.putExtra("selectedContact", 0);
                startActivity(intent);
            }
        });

        showListMessages();
    }

    @Override
    protected void onResume() {
        super.onResume();

        // update list
        showListMessages();
    }

    private void showListMessages() {
        messages = new ArrayList<>();

        int totalContacts = preferences.getInt("totalContacts", 0);

        for (int index = 1; index <= totalContacts; index++) {
            int totalMessages = preferences.getInt("totalMessages" + index, 0);

{'fraction_non_alphanumeric': 0.0872836719337848, 'fraction_numerical': 0.002508151492350138, 'mean_word_length': 3.3394994559303592, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6991687', 'n_tokens_mistral': 1017, 'n_tokens_neox': 967, 'n_words': 218}