package com.eni.android.custom.alertdialog;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ImageView;
import android.widget.TextView;

public class CustomAlertDialogEjemploActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
        Dialog dialog = new Dialog(CustomAlertDialogEjemploActivity.this);

        dialog.setContentView(R.layout.custom_alert);
        dialog.setTitle(R.string.popup_personalizado);

        TextView text = (TextView) dialog.findViewById(R.id.alert_msg);
        text.setText(R.string.mi_primer_popup_personalizado);
        ImageView image = (ImageView) dialog.findViewById(R.id.alert_img);
        image.setImageResource(R.drawable.nyan);
        
        dialog.show();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.custom_alert_dialog_ejemplo, menu);
		return true;
	}

}
