This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
07-19 16:46:22.009 23753-23753/com.instructure.candroid E/AndroidRuntime: FATAL EXCEPTION: main | |
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 | |
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251) | |
at java.util.ArrayList.get(ArrayList.java:304) | |
at com.instructure.candroid.fragment.CourseModulesFragment$GetModuleItemsAsyncTask.onPostExecute(CourseModulesFragment.java:892) | |
at com.instructure.candroid.fragment.CourseModulesFragment$GetModuleItemsAsyncTask.onPostExecute(CourseModulesFragment.java:842) | |
at android.os.AsyncTask.finish(AsyncTask.java:631) | |
at android.os.AsyncTask.access$600(AsyncTask.java:177) | |
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644) | |
at android.os.Handler.dispatchMessage(Handler.java:99) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void showFragment(ParentFragment fragment, int transition, int containerViewId) { | |
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); | |
if (containerViewId == NO_CONTAINER) { | |
containerViewId = R.id.activity_root; | |
} | |
if (currentFragment == null) { | |
fragmentTransaction.add(containerViewId, fragment); | |
} else { | |
fragmentTransaction.replace(containerViewId, fragment); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void selectTab(int itemPosition) { | |
//hide whatever was previously showing | |
hideCurrentFragment(); | |
currentTab = availableTabs.get(itemPosition); | |
//haven't determined where to go yet | |
if (currentTab == null) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////////////////////////////////////////// | |
// AsyncTask | |
/////////////////////////////////////////////////////////////////////////// | |
public final void addTask(AsyncTask task) { | |
asyncTasks.add(task); | |
} | |
public void addAndStartTask(AsyncTask task) { | |
addAndStartTask(task, null); |
NewerOlder