package fishrungames.kobserver;

import fishrungames.kobserver.JniWrapper;

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 SendMessageActivity extends Activity
{
	
	@Override
	protected void onCreate(Bundle icicle)
	{

		super.onCreate(icicle);

		setContentView(R.layout.send_message_layout);	
		
		Button backbtn = (Button) findViewById(R.id.backButton_send_message);
		backbtn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), MessagesActivity.class);
                startActivityForResult(myIntent, 0);
            }
        });
		
		
		

		Button sendMessageButton = (Button) findViewById(R.id.sendMessageButton);
		sendMessageButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                
            	EditText messageEdit = (EditText) findViewById(R.id.messageEdit);
                
            	JniWrapper.SendMessage(messageEdit.getText().toString());
            	
            	messageEdit.setText("");
            }
        });
		
	}
}