Пример #1
0
 private void createCrimes() {
   for (int i = 1; i <= 100; ++i) {
     Crime c = new Crime();
     c.setTitle("Crime #" + i);
     c.setSolved(i % 2 == 0);
     mCrimes.add(c);
   }
 }
Пример #2
0
 private CrimeLab(Context appContext) {
   mAppContext = appContext;
   mCrimes = new ArrayList<Crime>();
   for (int i = 0; i < 100; i++) {
     Crime c = new Crime();
     c.setTitle("Crime #" + i);
     c.setSolved((i % 2) == 0);
     mCrimes.add(c);
   }
 }
Пример #3
0
 // having a context allows the singleton to start activities access resources etc
 private CrimeLab(Context appContext) {
   mAppContext = appContext;
   mCrimes = new ArrayList<Crime>();
   // creates 100 crimes for the arraylist model layer
   for (int i = 0; i < 100; i++) {
     Crime c = new Crime();
     c.setTitle("Crime #" + i);
     c.setSolved(i % 2 == 0); // every other one
     mCrimes.add(c);
   }
 }