Permalink
Browse files

tri itinéraire ok

  • Loading branch information...
francgrim committed May 11, 2012
1 parent 35e9d80 commit 0dd0a6f3fb52b318d36687f9fd5d87071d956c53
@@ -121,7 +121,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
private void setListeners() {
View createButton = findViewById(R.id.create_itinerary);
createButton.setOnClickListener(this);
View deleteButton2 = findViewById(R.id.delete_itinerary);
deleteButton2.setOnClickListener(this);
@@ -204,11 +204,25 @@ public void onClick(DialogInterface dialog, int clicked) {
e.printStackTrace();
}
}
for(Integer i : itinerariesIDList){
try {
System.out.println(ItineraryController.getItineraryCategoryName(ItineraryController.getItinerary(i)));
} catch (Exception e) {
e.printStackTrace();
}
}
for (int i = 2; i < options_f.length; i++) {
if (!selections_f[i]) {
try {
for(Integer id: ItineraryController.getItineraryOfCategory(itinerariesIDList,CategoryController.getCategory(options_f[i].toString())))
System.out.println(i);
System.out.println(CategoryController.getCategoryTitle(CategoryController.getCategory(options_f[i].toString()).getId()));
ArrayList<Integer> itOfCatList = ItineraryController.getItineraryOfCategory(itinerariesIDList,CategoryController.getCategory(options_f[i].toString()));
System.out.println(itOfCatList.isEmpty());
for(Integer id: itOfCatList){
System.out.println(id);
itinerariesIDList.remove(id);
}
} catch (Exception e) {
e.printStackTrace();
}
@@ -224,9 +238,11 @@ public void onClick(DialogInterface dialog, int clicked) {
else{
itinerariesList = new String[itinerariesNamesList.size()];
itinerariesNamesList.toArray(itinerariesList);
for(String s :itinerariesList)
System.out.println(s);
adapter = new ArrayAdapter<String>(context,android.R.layout.simple_list_item_1,itinerariesList);
itinerariesListView.setAdapter(adapter);
//adapter.notifyDataSetChanged();
adapter.notifyDataSetChanged();
}
}
@@ -91,7 +91,7 @@ public static String getItineraryTitle(int id){
public static ArrayList<Integer> getItineraryOfCategory(ArrayList<Integer>itineraryID, Category category) throws Exception{
ArrayList<Integer>itinerariesOfCategory = new ArrayList<Integer>();
for(int id: itineraryID){
if(itineraryMapper.getItineraryCategory(id).getCategory().equals(category.getCategory())){
if(itineraryMapper.getItineraryCategory(id).getId()==category.getId()){
itinerariesOfCategory.add(id);
}
}

0 comments on commit 0dd0a6f

Please sign in to comment.