<commit_before>package com.support.android.designlibdemo;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.TabLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;

import com.support.android.designlibdemo.model.User;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import utils.MatchRequest;

public class NotificationHandlerActivity extends AppCompatActivity {
    private final String PETS_FOUND = "PETS_FOUND";
    private final String NEW_SEARCH_MATCHES = "NEW_SEARCH_MATCHES";
    private final String TAG = NotificationHandlerActivity.class.getSimpleName();
    private SharedPreferences prefs= null;
    private static User loginUser;
    private Context context;
    private String notificationType;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result_list_view);
        TextView titulo = (TextView) findViewById(R.id.titulo);
        titulo.setText("Resultados del Match");
        context = this;
        prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        loginUser = obtenerUsuario(getApplicationContext());
        setNotificationType(getIntent());
        cargarResultado();

    }

    public void cargarResultado(){
        String userId = loginUser.getId();
        QueryResultTask qTask = new QueryResultTask(userId, this.notificationType);
        qTask.execute((Void) null);
    }

    private User obtenerUsuario(Context context){
        User loginUser = null;
        try {
            JSONObject object = new JSONObject(prefs.getString("userData", "{}"));
            Log.e("USER DATA DETAIL", prefs.getString("userData", "{}"));
            if (object.length() == 0) {
                Toast.makeText(context, "Error cargando datos de usuario", Toast.LENGTH_SHORT).show();
                return null;
            }<commit_msg>Fix bug de doble pantalla de notificacion<commit_after>package com.support.android.designlibdemo;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.TabLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;

import com.support.android.designlibdemo.model.User;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import utils.MatchRequest;

public class NotificationHandlerActivity extends AppCompatActivity {
    private final String PETS_FOUND = "PETS_FOUND";
    private final String NEW_SEARCH_MATCHES = "NEW_SEARCH_MATCHES";
    private final String TAG = NotificationHandlerActivity.class.getSimpleName();
    private SharedPreferences prefs= null;
    private static User loginUser;
    private Context context;
    private String notificationType = "";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = this;
        prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        loginUser = obtenerUsuario(getApplicationContext());
        setNotificationType(getIntent());
        cargarResultado();

    }

    public void cargarResultado(){
        String userId = loginUser.getId();
        QueryResultTask qTask = new QueryResultTask(userId, this.notificationType);
        qTask.execute((Void) null);
    }

    private User obtenerUsuario(Context context){
        User loginUser = null;
        try {
            JSONObject object = new JSONObject(prefs.getString("userData", "{}"));
            Log.e("USER DATA DETAIL", prefs.getString("userData", "{}"));
            if (object.length() == 0) {
                Toast.makeText(context, "Error cargando datos de usuario", Toast.LENGTH_SHORT).show();
                return null;
            }
{'fraction_non_alphanumeric': 0.09564245810055866, 'fraction_numerical': 0.001787709497206704, 'mean_word_length': 3.8494041170097506, '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': '5532005', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1192, 'n_words': 268}