package com.example.hello.android.markdown_viewer;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity
	implements View.OnClickListener
{

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

		Button previewButton = (Button) findViewById(R.id.preview_button);
		previewButton.setOnClickListener(this);

	}

	public void onClick(View view)
	{
		EditText markdownSourceEditText = (EditText) findViewById(R.id.markdown_source_edittext);
		String markdownSourceText = markdownSourceEditText.getText().toString();

		Intent intent = new Intent(this, MarkdownViewerActivity.class);
		intent.putExtra(Intent.EXTRA_TEXT, markdownSourceText);
		startActivity(intent);
	}
}
