package org.upennapo.app;

import java.util.HashMap;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class DirectoryDetails extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.directory_details);
		TextView name = (TextView) findViewById(R.id.name);
		HashMap<String,String> map = (HashMap<String, String>) getIntent().getSerializableExtra(getString(R.string.dir_brother_data));
		String preferredName = map.get(Brother.PREFERRED_NAME_KEY);
		String firstName;
		if (preferredName.length() == 0){
			firstName = map.get(Brother.FIRST_NAME_KEY);
		}
		else{
			firstName = preferredName;
		}
		name.setText(firstName + " " + map.get(Brother.LAST_NAME_KEY)); 
		TextView emailAdd = (TextView) findViewById(R.id.email);
		emailAdd.setText(map.get(Brother.EMAIL_ADDRESS_KEY));
		TextView phone = (TextView) findViewById(R.id.phone);
		phone.setText(map.get(Brother.PHONE_NUMBER_KEY));
		TextView year = (TextView) findViewById(R.id.year);
		year.setText(map.get(Brother.GRADUATION_YEAR_KEY));
		TextView pledge = (TextView) findViewById(R.id.pledge_class);
		pledge.setText(map.get(Brother.PLEDGE_CLASS_KEY));
		TextView major = (TextView) findViewById(R.id.major);
		major.setText(map.get(Brother.MAJOR_KEY));
	}
}

@@ -95,45 +95,203 @@
 oid.
-os.Bundle;%0Aimport android.widget.Text
+content.Intent;%0Aimport android.os.Bundle;%0Aimport android.view.View.OnClickListener;%0Aimport android.widget.Button;%0Aimport android.widget.TextView;%0Aimport android.widget.Toast;%0Aimport android.view.
 View
@@ -1491,13 +1491,582 @@
 _KEY));%0A
+%09%09%0A%09%09%0A%09%09Button smsTo = (Button) findViewById(R.id.text_button);%0A%09%09smsTo.setOnClickListener(new OnClickListener () %7B%0A%09%09%09@Override %0A%09%09%09public void onClick(View v) %7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09Intent sendIntent = new Intent(Intent.ACTION_VIEW);%0A%09%09%09%09%09sendIntent.putExtra(%22sms body%22, %22default content%22);%0A%09%09%09%09%09sendIntent.setType(%22vnd.android-dir/mms-sms%22);%0A%09%09%09%09%09startActivity(sendIntent);%0A%09%09%09%09%7D%0A%09%09%09%09catch (Exception e) %7B%0A%09%09%09%09%09Toast.makeText(getApplicationContext(),%0A%09%09%09%09%09%09%22SMS failed, please try again later!%22,%0A%09%09%09%09%09%09Toast.LENGTH_LONG).show();%0A%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D);%0A
 %09%7D%0A%7D%0A

send SMS