4
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		appMediaPlayerFunctionLayoutParams = new AppMediaPlayerFunctionLayoutParams(this);
		appMediaPlayerFunctionLayoutParams.initParams();
		initLayoutAndCompont(); 
		mVideoView.setOnCompletionListener(this);
		mVideoView.setOnPreparedListener(this);
		if(!(getIntent().getAction() != null && getIntent().getAction().equals(Intent.ACTION_VIEW ))){
			 mVideoFileName = getIntent().getExtras().getString("file_name");
			 AppLog.e("mVideoFileName", mVideoFileName);
			 mVideoFilePosition = getIntent().getExtras().getInt("file_position");
		} 
		if (mVideoFileName == null)
		{ 
			mVideoFileName = getRealPath(getIntent().getData());
		} 
		mVideoView.setVideoPath(mVideoFileName);
		mVideoView.setMediaController(mController);
	} 
	AppMediaPlayerFunctionLayoutParams appMediaPlayerFunctionLayoutParams;
	 
	public void onPrepared(MediaPlayer mp) {
		mVideoView.start();
	} 
 
	public void onCompletion(MediaPlayer mp) {
		mVideoView.stopPlayback();
		finish();
	} 
	//得到文件的物理位置 
	private String getRealPath(Uri fileUrl){
		String fileName = null;
		Uri filePathUri = fileUrl;
		if(fileUrl!= null){
		if (fileUrl.getScheme().toString().compareTo("content")==0)
		{  
			Cursor cursor = getApplicationContext().getContentResolver().query(fileUrl, null, null, null, null);
		if (cursor != null && cursor.moveToFirst())
		{ 
			int column_index = cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA);
			fileName = cursor.getString(column_index); 
			cursor.close();
		} 
		}else if (fileUrl.getScheme().compareTo("file")==0)
		{ 
			fileName = filePathUri.toString();
			fileName = filePathUri.toString().replace("file://", "");
			} 
		} 
		//AppAppLog.e("videoPlayerActivty", "the realPath:" + fileName); 
			return fileName;
	} 
	/* 
	 * 设置布局 
	 */ 
	public void setLayout(){ 
		Parent.addView(mVideoView, appMediaPlayerFunctionLayoutParams.videoViewParams);
		setContentView(Parent);
	} 
	/* 
	 * 初始化布局,组建 
	 */ 
	public void initLayoutAndCompont(){ 
		Parent = new RelativeLayout(this);
		mVideoView = new VideoView(this);
		mController = new MediaController(this);
		Parent.addView(mVideoView, appMediaPlayerFunctionLayoutParams.videoViewParams);
		setContentView(Parent);
	} 
	/*