/** * Tries to get the info of the group from the db, if there isn't info, makes a request to the * 'google+ people' api to retrieve te about info of the gdg g+ profile and save it in the app db. */ private void initApi() { dbHandler = new DBHandler(getActivity()); try { GroupInfo groupInfo = dbHandler.getAllElements(GroupInfo.class, null, null, false).get(0); if (baseLayout.getVisibility() == View.GONE) baseLayout.setVisibility(View.VISIBLE); fillAboutUIElements(groupInfo); Url[] urls = (Url[]) dbHandler.getAllElements(Url.class, null, null, false).toArray(); fillUrlsLayout(urls); } catch (IndexOutOfBoundsException e) { ApiHandler apiHandler = new ApiHandler(getActivity()); apiHandler.getGdgAboutInfo(plusPersonData); d("[DEBUG] fucverg.saulmm.gdg.gui.fragments.GroupFragment.initApi ", "Making request..."); progressBarSpinner.setVisibility(View.VISIBLE); } }