package com.aluxoft.earrecognition.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.aluxoft.earrecognition.R;
import com.aluxoft.earrecognition.common.EarIdList;
import com.google.gson.Gson;

/**
 * Created by josejuliomartinez on 07/10/15.
 */
public class SelectUserActivity extends Activity {

    public static String currentSerializedEar;

    public EarIdList earIdList = null;

    //private EarIdList earIdList;

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

        String list = this.getIntent().getStringExtra("list");
        this.earIdList = new Gson().fromJson(list, EarIdList.class);
        SelectUserActivity.currentSerializedEar = this.earIdList.getCurrentFeature().serializeFeatures();

        Button registerButton = (Button) findViewById(R.id.register_commcare);

        registerButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent("org.commcare.dalvik.action.CommCareSession");
                String sssd = "COMMAND_ID" + " " + "root";
                i.putExtra("ccodk_session_request", sssd);
                SelectUserActivity.this.startActivity(i);
            }
        });


    }
}
