package com.eni.android.keyevent;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;

public class Ch7_KeyEventActivity extends Activity {
	private static final String KEY_EVENT_ACTIVITY = "KeyEventActivity";

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		super.onKeyDown(keyCode, event);
		if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
			Log.v(KEY_EVENT_ACTIVITY, getString(R.string.vous_avez_appuyer_sur_la_touche_volume_down));
			return true;
		}
		if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
			Log.v(KEY_EVENT_ACTIVITY, getString(R.string.vous_avez_appuyer_sur_la_touche_volume_up));
			return true;
		}
		return false;
	}
}