Advertisement
Ankhwatcher

Fragment onCreate

Apr 3rd, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. @Override
  2.     public void onCreate(Bundle savedInstanceState) {
  3.         super.onCreate(savedInstanceState);
  4.  
  5.         String[] uiBindFrom = { FixOpenHelper.LATITUDE, FixOpenHelper.LONGITUDE, FixOpenHelper.ACCURACY,
  6.                 FixOpenHelper.SPEED };
  7.         int[] uiBindTo = { R.id.latitudeText, R.id.longitudeText, R.id.accuracyText, R.id.speedText };
  8.  
  9.         getLoaderManager().initLoader(FIX_LIST_LOADER, null, this);
  10.  
  11.         FixOpenHelper fixOpenHelper = new FixOpenHelper(getActivity().getApplicationContext());
  12.         int routeNo = savedInstanceState.getInt("ROUTE_NUMBER", 1);
  13.         Cursor cursor = fixOpenHelper.routeFixes(routeNo);
  14.         adapter = new SimpleCursorAdapter(getActivity().getApplicationContext(), R.layout.captureroute_row, cursor,
  15.                 uiBindFrom, uiBindTo, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
  16.  
  17.         setListAdapter(adapter);
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement