By sorooshkhoram
on Mon, 09/15/2014 - 14:14
Hi
In my application I'm downloading a new dataset based on what the user does. After that I need to load and activate that dataset. I'm using the VideoPlayback example for that. My problem is I don't know where to do this. I read the swappable datasets but since it was done with unity I couldn't understand much. If I do it in
doLoadTrackersData
it won't be called after initialization anymore and if I put it in a costum method like this:
public boolean costumLoadTrackersData() { // Get the image tracker: TrackerManager trackerManager = TrackerManager.getInstance(); ImageTracker imageTracker = (ImageTracker) trackerManager .getTracker(ImageTracker.getClassType()); if (imageTracker == null) { Log.d( LOGTAG, "Failed to load tracking data set because the ImageTracker has not been initialized."); return false; } if(mLoadNewTrackersData) { // Create the data sets: dataSetStonesAndChips = imageTracker.createDataSet(); if (dataSetStonesAndChips == null) { Log.d(LOGTAG, "Failed to create a new tracking data."); return false; } // Load the data sets: if (!dataSetStonesAndChips.load(mTrackersDataPath, STORAGE_TYPE.STORAGE_ABSOLUTE)) { Log.d(LOGTAG, "Failed to load data set."); return false; } // Activate the data set: if (!imageTracker.activateDataSet(dataSetStonesAndChips)) { Log.d(LOGTAG, "Failed to activate data set."); return false; } Log.d(LOGTAG, "Successfully loaded and activated data set."); mLoadNewTrackersData = false; } return true; }
which is a copy & past of 'doLoadTrackersData' and call it in a method in VideoPlayback.java, ImageTracker will be null. Can someone tell me how I should do this?