-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrderListFragment.java
More file actions
77 lines (62 loc) · 1.97 KB
/
OrderListFragment.java
File metadata and controls
77 lines (62 loc) · 1.97 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package pizza.olin.consamables;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class OrderListFragment extends Fragment {
private static final String ARG_ORDER_ID = "order_id";
private String orderId;
private OrderListListener mListener;
public OrderListFragment() {
// Required empty public constructor
}
public static OrderListFragment newInstance(String orderId) {
OrderListFragment fragment = new OrderListFragment();
Bundle args = new Bundle();
args.putString(ARG_ORDER_ID, orderId);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
orderId = getArguments().getString(ARG_ORDER_ID);
}
// What is this?
if (orderId != null) {
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_order_list, container, false);
return view;
}
public void onButtonPressed(Uri uri) {
// What is this?
if (mListener != null) {
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OrderListListener) {
mListener = (OrderListListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OrderListListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
public interface OrderListListener {
}
}