use of com.ushahidi.android.app.models.ListReportModel in project Ushahidi_Android by ushahidi.
the class FetchReports method clearCachedData.
/**
* Clear saved reports
*/
public void clearCachedData() {
// delete reports
new ListReportModel().deleteReport();
// delete comment data
new ListCommentModel().deleteComments();
// delete fetched photos
ImageManager.deleteImages(this);
// delete pending photos
ImageManager.deletePendingImages(this);
// delete Open GeoSMS reports
Database.mOpenGeoSmsDao.deleteReports();
}
use of com.ushahidi.android.app.models.ListReportModel in project Ushahidi_Android by ushahidi.
the class AddReportActivity method showCategories.
// fetch categories
public String[] showCategories() {
ListReportModel mListReportModel = new ListReportModel();
List<CategoryEntity> listCategories = mListReportModel.getAllCategories();
if (listCategories != null && listCategories.size() > 0) {
int categoryCount = listCategories.size();
int categoryAmount = 0;
if (categoryCount > 0) {
categoryAmount = categoryCount;
} else {
mCategoriesId.clear();
mCategoriesTitle.clear();
categoryAmount = 1;
}
String[] categories = new String[categoryAmount];
mCategoryLength = categories.length;
int i = 0;
for (CategoryEntity category : mListReportModel.getAllCategories()) {
categories[i] = category.getCategoryTitle();
mCategoriesTitle.put(String.valueOf(category.getCategoryId()), category.getCategoryTitle());
mCategoriesId.add(category.getCategoryId());
i++;
}
return categories;
}
return null;
}
use of com.ushahidi.android.app.models.ListReportModel in project Ushahidi_Android by ushahidi.
the class MapFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mListReportModel = new ListReportModel();
mListReportModel.load();
mReportModel = mListReportModel.getReports();
showCategories();
mHandler = new Handler();
if (checkForGMap()) {
map = getMap();
Preferences.loadSettings(getActivity());
initMap();
map.setInfoWindowAdapter(new PopupAdapter(getLayoutInflater(savedInstanceState)));
map.setOnInfoWindowClickListener(this);
}
}
Aggregations