[Android] Intent 로 object 전달하기(Object passing by intent on Android)
public class QuarantineArea implements Serializable {
private static final long serialVersionUID = 1L;
// 다른 곳에서 동일 클래스명 쓸때의 구별 UID
double latitude;
double longitude;
final int radius = 20;
String address;
public QuarantineArea(double latitude, double longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
}
quarantineArea = new QuarantineArea(latitude, longitude);
Intent intent = new Intent(this.getBridge().getActivity(), BLEBackgroundService.class);
intent.putExtra("quarantineArea", quarantineArea);
getContext().startService(intent);