Skip to content

Instantly share code, notes, and snippets.

@PondThaitay
Created December 5, 2016 07:44
Show Gist options
  • Save PondThaitay/4589225aaa8b1e17edd6b389394395c1 to your computer and use it in GitHub Desktop.
Save PondThaitay/4589225aaa8b1e17edd6b389394395c1 to your computer and use it in GitHub Desktop.
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Realm.init(getApplicationContext());
List<Student> students = new ArrayList<>();
Student student = new Student();
student.setStudentId(10001);
student.setFirstName("Alex");
student.setLastName("Ferguson");
student.setGender("male");
student.setCity("Scotland");
student.setAge(19);
students.add(student);
student = new Student();
student.setStudentId(10002);
student.setFirstName("Ronaldo");
student.setLastName("Santos Aveiro");
student.setGender("male");
student.setCity("Portugal");
student.setAge(22);
students.add(student);
.
.
.
for (Student stu : students) {
StudentManager.getInstance().addStudent(stu);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment