package com.usai.apex;

import java.io.InputStream;

import org.apache.http.util.EncodingUtils;

import android.os.Bundle;
import android.app.Activity;
import android.content.pm.PackageManager.NameNotFoundException;
import android.util.Log;
import android.webkit.WebView;
import android.widget.TextView;

public class AboutActivity extends Activity
{

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		Log.d("AboutActivity", "onCreate");

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_about);
		final TextView tv_ver = (TextView) findViewById(R.id.tv_version);

		// String str =
		// "<a href='https://ra.apexshipping.com/main.php?action=handset_search&action_type=download_doc&sessionid=hjqvgilu0o64d22qfqgat1afk2&url=QVRwVUswa3ZFNlBFTzhLbFpYcC9rVEhSZ1h0MGd6ekpwZ2ZqTkhXNnN2SytGM0FhRkhyNG5QbkdtV2tPMXZrK2p3' target=_blank>A1303540085F.pdf</a>";

//		WebView wv = (WebView) findViewById(R.id.webView1);
//		String content = "";
//		try
//		{
//			InputStream in = getResources().openRawResource(R.raw.about);
//			// 获取文件的字节数
//			int lenght = in.available();
//			// 创建byte数组
//			byte[] buffer = new byte[lenght];
//			// 将文件中的数据读到byte数组中
//			in.read(buffer);
//			content = EncodingUtils.getString(buffer, "UTF-8");
//		}
//		catch (Exception e)
//		{
//			e.printStackTrace();
//		}
//		wv.getSettings().setDefaultTextEncodingName("UTF-8");
//		wv.loadData(content, "text/html", null);
//		
		
		try
		{
			
			tv_ver.setText(getText(R.string.str_ver)
					+ ApexTrackingApplication.get_instance()
							.getPackageManager()
							.getPackageInfo("com.usai.apex", 0).versionName);
		}
		catch (NameNotFoundException e1)
		{
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}
	//
	// @Override
	// public boolean onCreateOptionsMenu(Menu menu) {
	// // Inflate the menu; this adds items to the action bar if it is present.
	// getMenuInflater().inflate(R.menu.about, menu);
	// return true;
	// }

}
