package com.mobile.constellations.ui;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

import com.mobile.constellations.R;
import com.mobile.constellations.util.ViewHolder;

/**
 * 星座配对
 * 
 * @author Linda
 * 
 */
public class PairActivity extends Activity implements OnClickListener, OnItemClickListener {

	private String[] allCons;
	private MyAdapter myAdapter;
	private ListView listViewGirl;
	private ListView listViewBoy;
	private Dialog dialogBoy;
	private Dialog dialogGirl;
	private TextView boy;
	private TextView girl;
	private TextView content;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_pair);
		// 重置标题
		resetTitlebar();
		// 初始化UI
		initUI();
		showAd();
	}

	private void showAd() {

	}

	private void initUI() {
		allCons = getResources().getStringArray(R.array.all_constellation_pair);
		boy = (TextView) findViewById(R.id.boy);
		girl = (TextView) findViewById(R.id.girl);
		TextView search = (TextView) findViewById(R.id.search);
		content = (TextView) findViewById(R.id.content);
		boy.setOnClickListener(this);
		girl.setOnClickListener(this);
		search.setOnClickListener(this);
	}

	private void resetTitlebar() {
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.view_comm_titlebar);
		TextView title = (TextView) findViewById(R.id.titlebar_title);
		LinearLayout back = (LinearLayout) findViewById(R.id.titlebar_left_layout);
		title.setText("星座配对");
		back.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});
	}

	private class MyAdapter extends BaseAdapter {

		@Override
		public int getCount() {
			return allCons.length;
		}

		@Override
		public Object getItem(int position) {
			return null;
		}

		@Override
		public long getItemId(int position) {
			return 0;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			// 适配器优化
			if (convertView == null) {
				convertView = getLayoutInflater().inflate(R.layout.item_listview_pair, null);
			}
			// 将对应数据显示到对应控件上
			TextView tv = ViewHolder.get(convertView, R.id.textView1);
			tv.setText(allCons[position]);
			return convertView;
		}
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		// 男星座点击事件
		case R.id.boy:
			// 自定义dialog对话框
			View layout1 = getLayoutInflater().inflate(R.layout.pair_constellation_boy, null);
			dialogBoy = new AlertDialog.Builder(this).create();
			// 显示dialog对话框
			dialogBoy.show();
			dialogBoy.getWindow().setContentView(layout1);
			// 找到对话框对应的控件
			TextView titleBoy = (TextView) layout1.findViewById(R.id.title);
			listViewBoy = (ListView) layout1.findViewById(R.id.listView1);
			titleBoy.setText("男星座");
			// listview设置适配器
			myAdapter = new MyAdapter();
			listViewBoy.setAdapter(myAdapter);
			listViewBoy.setOnItemClickListener(this);
			break;

		// 女星座点击事件
		case R.id.girl:
			// 自定义dialog对话框
			View layout = getLayoutInflater().inflate(R.layout.pair_constellation_girl, null);
			dialogGirl = new AlertDialog.Builder(this).create();
			// 显示dialog对话框
			dialogGirl.show();
			dialogGirl.getWindow().setContentView(layout);
			// 找到对话框对应的控件
			TextView titleGirl = (TextView) layout.findViewById(R.id.title);
			listViewGirl = (ListView) layout.findViewById(R.id.listView1);
			titleGirl.setText("女星座");
			// listview设置适配器
			myAdapter = new MyAdapter();
			listViewGirl.setAdapter(myAdapter);
			listViewGirl.setOnItemClickListener(this);
			break;

		// 查询点击事件
		case R.id.search:
			String boystr = boy.getText().toString().trim();
			String girlstr = girl.getText().toString().trim();
			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("白羊座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.baiyangnan_to_baiyangnv));
			} else if (boystr.equals("白羊座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.baiyangnan_to_jinniunv));
			} else if (boystr.equals("白羊座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.baiyangnan_to_shuangzinv));
			} else if (boystr.equals("白羊座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.baiyangnan_to_juxienv));
			} else if (boystr.equals("白羊座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.baiyangnan_to_shizinv));
			} else if (boystr.equals("白羊座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.baiyangnan_to_chunvnv));
			} else if (boystr.equals("白羊座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.baiyangnan_to_tianchengnv));
			} else if (boystr.equals("白羊座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.baiyangnan_to_tianxienv));
			} else if (boystr.equals("白羊座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.baiyangnan_to_sheshounv));
			} else if (boystr.equals("白羊座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.baiyangnan_to_mojienv));
			} else if (boystr.equals("白羊座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.baiyangnan_to_shuipingnv));
			} else if (boystr.equals("白羊座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.baiyangnan_to_shuangyunv));
			} else
			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("金牛座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.jinniunan_to_baiyangnv));
			} else if (boystr.equals("金牛座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.jinniunan_to_jinniunv));
			} else if (boystr.equals("金牛座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.jinniunan_to_shuangzinv));
			} else if (boystr.equals("金牛座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.jinniunan_to_juxienv));
			} else if (boystr.equals("金牛座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.jinniunan_to_shizinv));
			} else if (boystr.equals("金牛座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.jinniunan_to_chunvnv));
			} else if (boystr.equals("金牛座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.jinniunan_to_tianchengnv));
			} else if (boystr.equals("金牛座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.jinniunan_to_tianxienv));
			} else if (boystr.equals("金牛座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.jinniunan_to_sheshounv));
			} else if (boystr.equals("金牛座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.jinniunan_to_mojienv));
			} else if (boystr.equals("金牛座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.jinniunan_to_shuipingnv));
			} else if (boystr.equals("金牛座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.jinniunan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("双子座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.shuangzinan_to_baiyangnv));
			} else if (boystr.equals("双子座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.shuangzinan_to_jinniunv));
			} else if (boystr.equals("双子座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.shuangzinan_to_shuangzinv));
			} else if (boystr.equals("双子座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.shuangzinan_to_juxienv));
			} else if (boystr.equals("双子座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.shuangzinan_to_shizinv));
			} else if (boystr.equals("双子座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.shuangzinan_to_chunvnv));
			} else if (boystr.equals("双子座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.shuangzinan_to_tianchengnv));
			} else if (boystr.equals("双子座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.shuangzinan_to_tianxienv));
			} else if (boystr.equals("双子座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.shuangzinan_to_sheshounv));
			} else if (boystr.equals("双子座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.shuangzinan_to_mojienv));
			} else if (boystr.equals("双子座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.shuangzinan_to_shuipingnv));
			} else if (boystr.equals("双子座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.shuangzinan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("巨蟹座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.juxienan_to_baiyangnv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.juxienan_to_jinniunv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.juxienan_to_shuangzinv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.juxienan_to_juxienv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.juxienan_to_shizinv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.juxienan_to_chunvnv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.juxienan_to_tianchengnv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.juxienan_to_tianxienv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.juxienan_to_sheshounv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.juxienan_to_mojienv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.juxienan_to_shuipingnv));
			} else if (boystr.equals("巨蟹座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.juxienan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("狮子座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.shizinan_to_baiyangnv));
			} else if (boystr.equals("狮子座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.shizinan_to_jinniunv));
			} else if (boystr.equals("狮子座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.shizinan_to_shuangzinv));
			} else if (boystr.equals("狮子座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.shizinan_to_juxienv));
			} else if (boystr.equals("狮子座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.shizinan_to_shizinv));
			} else if (boystr.equals("狮子座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.shizinan_to_chunvnv));
			} else if (boystr.equals("狮子座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.shizinan_to_tianchengnv));
			} else if (boystr.equals("狮子座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.shizinan_to_tianxienv));
			} else if (boystr.equals("狮子座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.shizinan_to_sheshounv));
			} else if (boystr.equals("狮子座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.shizinan_to_mojienv));
			} else if (boystr.equals("狮子座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.shizinan_to_shuipingnv));
			} else if (boystr.equals("狮子座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.shizinan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("处女座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.chunvnan_to_baiyangnv));
			} else if (boystr.equals("处女座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.chunvnan_to_jinniunv));
			} else if (boystr.equals("处女座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.chunvnan_to_shuangzinv));
			} else if (boystr.equals("处女座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.chunvnan_to_juxienv));
			} else if (boystr.equals("处女座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.chunvnan_to_shizinv));
			} else if (boystr.equals("处女座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.chunvnan_to_chunvnv));
			} else if (boystr.equals("处女座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.chunvnan_to_tianchengnv));
			} else if (boystr.equals("处女座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.chunvnan_to_tianxienv));
			} else if (boystr.equals("处女座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.chunvnan_to_sheshounv));
			} else if (boystr.equals("处女座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.chunvnan_to_mojienv));
			} else if (boystr.equals("处女座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.chunvnan_to_shuipingnv));
			} else if (boystr.equals("处女座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.chunvnan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("天秤座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.tianchengnan_to_baiyangnv));
			} else if (boystr.equals("天秤座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.tianchengnan_to_jinniunv));
			} else if (boystr.equals("天秤座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.tianchengnan_to_shuangzinv));
			} else if (boystr.equals("天秤座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.tianchengnan_to_juxienv));
			} else if (boystr.equals("天秤座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.tianchengnan_to_shizinv));
			} else if (boystr.equals("天秤座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.tianchengnan_to_chunvnv));
			} else if (boystr.equals("天秤座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.tianchengnan_to_tianchengnv));
			} else if (boystr.equals("天秤座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.tianchengnan_to_tianxienv));
			} else if (boystr.equals("天秤座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.tianchengnan_to_sheshounv));
			} else if (boystr.equals("天秤座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.tianchengnan_to_mojienv));
			} else if (boystr.equals("天秤座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.tianchengnan_to_shuipingnv));
			} else if (boystr.equals("天秤座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.tianchengnan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("天蝎座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.tianxienan_to_baiyangnv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.tianxienan_to_jinniunv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.tianxienan_to_shuangzinv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.tianxienan_to_juxienv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.tianxienan_to_shizinv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.tianxienan_to_chunvnv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.tianxienan_to_tianchengnv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.tianxienan_to_tianxienv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.tianxienan_to_sheshounv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.tianxienan_to_mojienv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.tianxienan_to_shuipingnv));
			} else if (boystr.equals("天蝎座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.tianxienan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("射手座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.sheshounan_to_baiyangnv));
			} else if (boystr.equals("射手座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.sheshounan_to_jinniunv));
			} else if (boystr.equals("射手座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.sheshounan_to_shuangzinv));
			} else if (boystr.equals("射手座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.sheshounan_to_juxienv));
			} else if (boystr.equals("射手座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.sheshounan_to_shizinv));
			} else if (boystr.equals("射手座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.sheshounan_to_chunvnv));
			} else if (boystr.equals("射手座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.sheshounan_to_tianchengnv));
			} else if (boystr.equals("射手座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.sheshounan_to_tianxienv));
			} else if (boystr.equals("射手座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.sheshounan_to_sheshounv));
			} else if (boystr.equals("射手座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.sheshounan_to_mojienv));
			} else if (boystr.equals("射手座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.sheshounan_to_shuipingnv));
			} else if (boystr.equals("射手座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.sheshounan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("摩羯座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.mojienan_to_baiyangnv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.mojienan_to_jinniunv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.mojienan_to_shuangzinv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.mojienan_to_juxienv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.mojienan_to_shizinv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.mojienan_to_chunvnv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.mojienan_to_tianchengnv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.mojienan_to_tianxienv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.mojienan_to_sheshounv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.mojienan_to_mojienv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.mojienan_to_shuipingnv));
			} else if (boystr.equals("摩羯座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.mojienan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("水瓶座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.shuipingnan_to_baiyangnv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.shuipingnan_to_jinniunv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.shuipingnan_to_shuangzinv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.shuipingnan_to_juxienv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.shuipingnan_to_shizinv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.shuipingnan_to_chunvnv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.shuipingnan_to_tianchengnv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.shuipingnan_to_tianxienv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.shuipingnan_to_sheshounv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.shuipingnan_to_mojienv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.shuipingnan_to_shuipingnv));
			} else if (boystr.equals("水瓶座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.shuipingnan_to_shuangyunv));
			} else

			// 匹配对应参数，显示配对的具体内容
			if (boystr.equals("双鱼座") && girlstr.equals("白羊座")) {
				content.setText(getString(R.string.shuangyunan_to_baiyangnv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("金牛座")) {
				content.setText(getString(R.string.shuangyunan_to_jinniunv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("双子座")) {
				content.setText(getString(R.string.shuangyunan_to_shuangzinv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("巨蟹座")) {
				content.setText(getString(R.string.shuangyunan_to_juxienv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("狮子座")) {
				content.setText(getString(R.string.shuangyunan_to_shizinv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("处女座")) {
				content.setText(getString(R.string.shuangyunan_to_chunvnv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("天秤座")) {
				content.setText(getString(R.string.shuangyunan_to_tianchengnv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("天蝎座")) {
				content.setText(getString(R.string.shuangyunan_to_tianxienv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("射手座")) {
				content.setText(getString(R.string.shuangyunan_to_sheshounv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("摩羯座")) {
				content.setText(getString(R.string.shuangyunan_to_mojienv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("水瓶座")) {
				content.setText(getString(R.string.shuangyunan_to_shuipingnv));
			} else if (boystr.equals("双鱼座") && girlstr.equals("双鱼座")) {
				content.setText(getString(R.string.shuangyunan_to_shuangyunv));
			}
			break;

		default:
			break;
		}
	}

	@Override
	// listview的行点击事件
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		// 男星座的行点击事件
		if (parent == listViewBoy) {
			dialogBoy.dismiss();
			StringBuffer buffer = new StringBuffer();
			String boyStr = buffer.append(allCons[position]).substring(0, 4);
			boy.setText(boyStr);
			// 女星座的行点击事件
		} else if (parent == listViewGirl) {
			dialogGirl.dismiss();
			StringBuffer buffer = new StringBuffer();
			String girlStr = buffer.append(allCons[position]).substring(0, 4);
			girl.setText(girlStr);
		}
	}

}
