package com.eni.android.viewstub;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ViewStubEjemploActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
        
        final View stub = findViewById(R.id.view_stub);
        
        Button enable = (Button) findViewById(R.id.enable);
        enable.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				stub.setVisibility(View.VISIBLE);
			}
		});
    }

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

}
