package com.mzeat.ui;
import com.mzeat.R;
import com.mzeat.util.UpdateManager;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class AboutActivity extends BaseActivity {
private TextView mVersion;
private RelativeLayout mUpdate;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
//获取客户端版本信息
try {
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), 0);
mVersion = (TextView)findViewById(R.id.tv_version);
mVersion.setText(info.versionName);
} catch (NameNotFoundException e) {
e.printStackTrace(System.err);
}
mUpdate = (RelativeLayout)findViewById(R.id.checkversion);
mUpdate.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
UpdateManager.getUpdateManager().checkAppUpdate(AboutActivity.this, true);
}
});
}
}