// // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower decompiler) // package com.gesoftoa.base; import android.app.ActionBar; import android.app.Activity; import android.app.ProgressDialog; import android.app.AlertDialog.Builder; import android.content.Context; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageButton; import android.widget.TextView; import com.gesoftoa.common.DataUtils; import com.gesoftoa.common.HttpUtils; import org.json.JSONObject; public abstract class BaseActivity extends Activity { protected HttpUtils mHttp; protected Context mContext; protected ProgressDialog mProgressDialog; protected Builder mAlert; protected ActionBar mActionbar; protected String mLoginName; protected String mUserNo; protected JSONObject mJsonUser; public BaseActivity() { } protected void onDestroy() { super.onDestroy(); this.mProgressDialog.dismiss(); } protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.mContext = this; this.mHttp = HttpUtils.getInstance(this.mContext); this.mJsonUser = DataUtils.getLoginUserInfo(this.mContext); this.mLoginName = this.mJsonUser.optString("loginName"); this.mUserNo = this.mJsonUser.optString("userNo"); this.mActionbar = this.getActionBar(); this.mActionbar.setCustomView(2130903040); this.mActionbar.setDisplayOptions(16); this.mProgressDialog = new ProgressDialog(this.mContext); this.mProgressDialog.setMessage("正在处理请稍后..."); this.mAlert = this.getAlert(); this.getLeftBtn(); this.setCustomTitle(this.getTitle() + ""); this.onCreateGe(savedInstanceState); } protected abstract void onCreateGe(Bundle var1); protected void setCustomTitle(String title) { TextView tvTitle = (TextView)this.mActionbar.getCustomView().findViewById(2131361793); tvTitle.setText(title); } protected ImageButton getLeftBtn() { ImageButton imgBtn = (ImageButton)this.findViewById(2131361792); imgBtn.setOnClickListener(new OnClickListener() { public void onClick(View v) { BaseActivity.this.onBack(v); } }); return imgBtn; } private void onBack(View view) { this.finish(); } protected ImageButton getRightBtn() { ImageButton imgBtn = (ImageButton)this.findViewById(2131361794); imgBtn.setVisibility(0); return imgBtn; } private Builder getAlert() { Builder alert = new Builder(this.mContext); alert.setTitle("提示"); alert.setNegativeButton("确定", (android.content.DialogInterface.OnClickListener)null); return alert; } }