Skip to content

Instantly share code, notes, and snippets.

@selmanon
Created November 28, 2014 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save selmanon/a92b102d0d68e35da246 to your computer and use it in GitHub Desktop.
Save selmanon/a92b102d0d68e35da246 to your computer and use it in GitHub Desktop.
DB Access
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
myView = inflater.inflate(R.layout.fragment_ma_carte, container, false);
ButterKnife.inject(this, myView);
// 1. Get How many Carts are in DB
MainApplication.setCarteNumber(MainApplication.myDbHelper.getCarteFidelites().get(0).getCompteurCarteFidelite());
// 2. Update The View
for (int i = 0; i <= MainApplication.getCarteNumber(); i++) {
myView.findViewById(idsArray[i]).setBackgroundResource(R.drawable.logocouleur);
}
return myView;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment