Created
December 5, 2016 07:44
-
-
Save PondThaitay/4589225aaa8b1e17edd6b389394395c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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