|  |  |  | 
|---|
|  |  |  | public class HNBaseActivity extends BaseActivity { | 
|---|
|  |  |  | private final String TAG = "BaseActivity"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public TitleBar titleBar = null; | 
|---|
|  |  |  | //z主线程查询 | 
|---|
|  |  |  | public AppDatabase baseDao; | 
|---|
|  |  |  | //异步线程查询 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @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(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|