package com.eni.android.parcelableejemplo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class ConnectedActivity extends Activity {

	private TextView login;
	private TextView password;
	
	private final String EXTRA_USER = "user";
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.connect);
		
		Intent intent = getIntent();
		User user = intent.getParcelableExtra(EXTRA_USER);
		
		login = (TextView) findViewById(R.id.userLogin);
		login.setText(user.getUsername());
		password = (TextView) findViewById(R.id.userPassword);
		password.setText(user.getPassword());
	}

}
