package com.wasu.cs.ui;

import java.util.HashMap;
import java.util.Map;

import cn.com.wasu.main.IntentConstant;

import com.wasu.authsdk.AuthSDK;
import com.wasu.authsdk.IAuthInterface;
import com.wasu.cs.jsobject.WR;
import com.wasu.module.log.WLog;
import com.wasu.statistics.StatisticsConstant;
import com.wasu.statistics.WasuStatistics;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class ActivityOpenApp extends Activity {
	private String TAG = "ActivityOpenApp";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		WLog.i(TAG,"onCreate()");
		
		setTheme(android.R.style.Theme_NoDisplay);
		
		parseIntent();
		//每个页面都添加TVID属性
		Map<String, String> map=new HashMap<String, String>();
		map.put(StatisticsConstant.TVID, AuthSDK.getInstance().getValue(IAuthInterface.KEY_TVID));
		WasuStatistics.getInstance().addPageElem(map);
		finish();
	}
	
	/**
	 * 解析intent
	 */
	private void parseIntent() {
		Intent i = getIntent();
		if (i == null){
			i = new Intent();
		}
		
		String layoutCode 	= i.getStringExtra(IntentConstant.LAYOUT_CODE.value());
		String jsonUrl		= i.getStringExtra(IntentConstant.DATAURI.value());
		
		new WR(this).startApk(jsonUrl);
	}
}
