use of com.xxmassdeveloper.mpchartexample.notimportant.ContentItem in project MPAndroidChart by PhilJay.
the class RealmMainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
setTitle("Realm.io Examples");
ArrayList<ContentItem> objects = new ArrayList<ContentItem>();
objects.add(new ContentItem("Line Chart", "Creating a LineChart with Realm.io database"));
objects.add(new ContentItem("Bar Chart", "Creating a BarChart with Realm.io database"));
objects.add(new ContentItem("Horizontal Bar Chart", "Creating a HorizontalBarChart with Realm.io database"));
objects.add(new ContentItem("Scatter Chart", "Creating a ScatterChart with Realm.io database"));
objects.add(new ContentItem("Candle Stick Chart", "Creating a CandleStickChart with Realm.io database"));
objects.add(new ContentItem("Bubble Chart", "Creating a BubbleChart with Realm.io database"));
objects.add(new ContentItem("Pie Chart", "Creating a PieChart with Realm.io database"));
objects.add(new ContentItem("Radar Chart", "Creating a RadarChart with Realm.io database"));
objects.add(new ContentItem("Realm Wiki", "This is the code related to the wiki entry about realm.io on the MPAndroidChart github page."));
MyAdapter adapter = new MyAdapter(this, objects);
ListView lv = (ListView) findViewById(R.id.listView1);
lv.setAdapter(adapter);
lv.setOnItemClickListener(this);
Realm.init(this);
// Create a RealmConfiguration that saves the Realm file in the app's "files" directory.
RealmConfiguration realmConfig = new RealmConfiguration.Builder().build();
Realm.setDefaultConfiguration(realmConfig);
Realm realm = Realm.getDefaultInstance();
realm.beginTransaction();
realm.deleteAll();
realm.commitTransaction();
}
Aggregations