| | |
| | | import com.dayu.baselibrary.view.TitleBar; |
| | | import com.dayu.henanlibrary.R; |
| | | import com.dayu.henanlibrary.dao.AppDatabase; |
| | | import com.dayu.henanlibrary.dao.BaseDaoSingleton; |
| | | import com.dayu.henanlibrary.dao.HNBaseDaoSingleton; |
| | | |
| | | /** |
| | | * Created by zuoxiao on 2018/12/20. |
| | |
| | | public class HNBaseActivity extends BaseActivity { |
| | | private final String TAG = "BaseActivity"; |
| | | |
| | | public TitleBar titleBar = null; |
| | | //z主线程查询 |
| | | public AppDatabase baseDao; |
| | | //异步线程查询 |
| | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | baseDao = BaseDaoSingleton.getInstance(this); |
| | | asynchBaseDao = BaseDaoSingleton.getAsynchInstance(this); |
| | | baseDao = HNBaseDaoSingleton.getInstance(this); |
| | | asynchBaseDao = HNBaseDaoSingleton.getAsynchInstance(this); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void onResume() { |
| | | super.onResume(); |
| | | } |
| | | |
| | | @Override |
| | | public void setContentView(View layoutResID) { |
| | | super.setContentView(layoutResID); |
| | | try { |
| | | View view = findViewById(R.id.titleBar); |
| | | |
| | | if (view != null && view instanceof TitleBar) { |
| | | titleBar = (TitleBar) view; |
| | | titleBar.setOnItemclickListner(TitleBar.ClickType_LEFT_IMAGE, v -> finish()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |