Advertisement
Ankhwatcher

ListFragment onCreate()

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