-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainActivity.java
More file actions
42 lines (36 loc) · 1.21 KB
/
MainActivity.java
File metadata and controls
42 lines (36 loc) · 1.21 KB
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
40
41
42
package com.munisystem.porst;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import com.munisystem.porst.fragments.MainFragment;
public class MainActivity extends AppCompatActivity implements MainFragment.OnMainFragmentInteractionListener {
private static final String TAG = MainActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, MainFragment.newInstance())
.commit();
}
@Override
public void onCardItemClick(View v) {
String text = "";
switch (v.getId()) {
case R.id.card_rental: {
text = "貸出";
break;
}
case R.id.card_return: {
text = "返却";
break;
}
case R.id.card_status: {
text = "状態";
break;
}
}
Log.d(TAG, "onCardItemClick: " + text + " が押されました。");
}
}