package com.example.pipo;

import android.view.Window;

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

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//requestWindowFeature(Window.FEATURE_LEFT_ICON);
		//FEATURE_CUSTOM_TITLE
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		
		
		setContentView(R.layout.activity_main);
		
		 TextView textView = (TextView)findViewById(R.id.custom_title_text);
	        textView.setText("Custom Title");
		
		 getWindow().setTitle("This is just a test");

	       getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
	              android.R.drawable.ic_dialog_alert);
		
	}

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

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
