-
-
Notifications
You must be signed in to change notification settings - Fork 316
Expand file tree
/
Copy pathMainActivity.java
More file actions
39 lines (32 loc) · 983 Bytes
/
MainActivity.java
File metadata and controls
39 lines (32 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.parse.ui.widget.sample;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.sample_recycler).setOnClickListener(this);
findViewById(R.id.sample_list).setOnClickListener(this);
}
//region OnClickListener
@Override
public void onClick(View v) {
int id = v.getId();
switch (id) {
case R.id.sample_recycler: {
Intent intent = new Intent(this, RecyclerActivity.class);
startActivity(intent);
break;
}
case R.id.sample_list: {
Intent intent = new Intent(this, ListActivity.class);
startActivity(intent);
break;
}
}
}
//endregion
}