@Override protected void onResume() { super.onResume(); loadHome(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); registerNofitication(true); headerView = getView(R.id.activitymain_headerview); headerView.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { if (dbUserLogin.isLogin()) { logout(); } else { login(); } } }); headerView.updateButton(dbUserLogin.isLogin()); listView = getView(R.id.mainactivity_listview); List<Object> list = new ArrayList<Object>(); templete(list); listView.setAdapter( new BaseAdapter( this, list, new CommonGenderView() { @Override public CustomLinearLayoutView getView(Context context, Object data) { return new S2ItemView(context); } })); setupListView(listView); listView.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { S2Item item = (S2Item) parent.getItemAtPosition(position); if (!CommonAndroid.NETWORK.haveConnectTed(view.getContext())) { // if (item.res == R.drawable.main_img_1 // || item.res == R.drawable.main_img_3 // || item.res == R.drawable.main_img_7 // || item.res == R.drawable.main_img_8) { MintUtils.showDialog( view.getContext(), "Mint Medical. Network connection unavailable"); return; // } } if (item.res == R.drawable.main_img_7 || item.res == R.drawable.main_img_4) { gotoPage(item); } else { if (dbUserLogin.isLogin()) { gotoPage(item); } else { login(); } } } }); }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); }