|
|
@@ -300,6 +300,19 @@ public class DetailFragment extends Fragment implements OnClickListener /*
|
|
|
// }
|
|
|
|
|
|
private ShipMap mTrackingMap;
|
|
|
+ private int mSelectTrackingPosition = -1;
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onSaveInstanceState(Bundle outState) {
|
|
|
+ super.onSaveInstanceState(outState);
|
|
|
+
|
|
|
+ if (mContent != null) {
|
|
|
+ outState.putString("content",mContent.toString());
|
|
|
+ }
|
|
|
+ outState.putInt("selectContactPosition",mSelectContactPosition);
|
|
|
+ outState.putInt("selectTrackingPosition",mSelectTrackingPosition);
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
|
@@ -320,6 +333,12 @@ public class DetailFragment extends Fragment implements OnClickListener /*
|
|
|
mTrackingMap = null;
|
|
|
}
|
|
|
|
|
|
+ if (savedInstanceState != null) {
|
|
|
+ fragment_content = savedInstanceState.getString("content");
|
|
|
+ mSelectContactPosition = savedInstanceState.getInt("selectContactPosition");
|
|
|
+ mSelectTrackingPosition = savedInstanceState.getInt("selectTrackingPosition");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// if(this.getArguments().getString("action_type").equals("Tracing"))
|
|
|
// {
|
|
|
@@ -716,6 +735,7 @@ public class DetailFragment extends Fragment implements OnClickListener /*
|
|
|
listview.addView(listitem);
|
|
|
// ViewGroup.LayoutParams lp1=listitem.getLayoutParams();
|
|
|
|
|
|
+ final int selectIndex = i;
|
|
|
listitem.setOnClickListener(new OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
@@ -725,10 +745,21 @@ public class DetailFragment extends Fragment implements OnClickListener /*
|
|
|
if (location != null) {
|
|
|
mTrackingMap.showShipAnnotation(location);
|
|
|
}
|
|
|
+ mSelectTrackingPosition = selectIndex;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ if (mSelectTrackingPosition == i) {
|
|
|
+ if (mTrackingMap != null) {
|
|
|
+ JSONObject location = groupobj.optJSONObject("location");
|
|
|
+ if (location != null) {
|
|
|
+ mTrackingMap.showShipAnnotation(location);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|