* Copyright (c) 2009 Ferenc Hechler - ferenc_hechler@users.sourceforge.net
 * This file is part of AndroMaze
 * AndroMaze is free software;
 * you can redistribute it and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation;
 * either version 2 of the License, or (at your option) any later version.
 * AndroMaze is distributed
 * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with the AndroMaze;
 * if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
package de.hechler.andmaz;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

 * This class provides a basic demonstration of how to write an Android
 * activity. Inside of its window, it places a single view: an EditText that
 * displays and edits some internal text.
public class AndroMazeHelpActivity extends Activity {

	Button btBack;
	Button btReleaseNotes;
    public void onCreate(Bundle savedInstanceState) {

		// create view from xml

        // find buttons in view
        btBack = ((Button) findViewById(R.id.btBack));
        btReleaseNotes = ((Button) findViewById(R.id.btReleaseNotes));
        // set actions for buttons

    OnClickListener ExitListener = new OnClickListener() {
        public void onClick(View v) {
    OnClickListener ReleaseNotesListener = new OnClickListener() {
        public void onClick(View v) {
    protected Dialog onCreateDialog(int id) {
        switch (id) {
        case AndroMazeActivity.SPLASH_SCREEN:
	        LayoutInflater factory = LayoutInflater.from(this);
	        final View splashView = factory.inflate(R.layout.splash_screen, null);
			final TextView tvReleaseNotes = (TextView)splashView.findViewById(R.id.release_text);
			String release_notes = Helper.readRawResource(this, "release_notes");
			if (release_notes != null) {
				release_notes = release_notes.replaceAll("\\r\\n", "\n");
	        return new AlertDialog.Builder(this)
	            .setTitle("New in Release "+AndroMazeActivity.VERSION)
	            .setPositiveButton("OK", new DialogInterface.OnClickListener() {
	                public void onClick(DialogInterface dialog, int whichButton) {
	                	SimplePersistence persist = new SimplePersistence(AndroMazeHelpActivity.this, "AndroMaze");
	                	persist.putString("version", AndroMazeActivity.VERSION);
	    return null;