package com.example.patrice.occupation03;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

/**
 * Created by Patrice on 24/06/2018.
 */

public class token extends AppCompatActivity
{
    private TextView text_Token;

    public static final String TAG_TOKEN = "token";

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

        text_Token = (TextView) findViewById(R.id.text_Token);

        String token = getSharedPreferences("PREFERENCE", MODE_PRIVATE).getString(TAG_TOKEN, null);

        //if token is not null
        if (token != null)
        {
            //displaying the token
            text_Token.setText(token);


        } else {
            //if token is null that means something wrong
            text_Token.setText("Token not generated");
        }

    }
}
