package com.meisterschueler.ognviewer;

import android.app.ListFragment;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

import java.util.Map;

public class ManageIDsFragment extends ListFragment {

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        CustomAircraftDescriptorProvider adp1 = (CustomAircraftDescriptorProvider) AircraftDescriptorProviderHelper.getCustomDbAircraftDescriptorProvider();
        Map<String,CustomAircraftDescriptor> aircraftDescriptorMap =  adp1.getAircraftDescriptorMap();

        CustomAircraftDescriptorAdapter adapter = new CustomAircraftDescriptorAdapter(getActivity(), aircraftDescriptorMap.values().toArray(new CustomAircraftDescriptor[aircraftDescriptorMap.size()]));
        setListAdapter(adapter);
    }

    @Override
    public void onListItemClick(ListView l, View v, int position, long id) {
        CustomAircraftDescriptor cad = (CustomAircraftDescriptor) getListAdapter().getItem(position);
        AircraftDialog.showDialog(getActivity(), cad);
    }
}

@@ -92,16 +92,106 @@
 Bundle;%0A
+import android.view.Menu;%0Aimport android.view.MenuInflater;%0Aimport android.view.MenuItem;%0A
 import a
@@ -317,16 +317,801 @@
 agment %7B
+%0A    @Override%0A    public void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        setHasOptionsMenu(true);%0A    %7D%0A%0A    @Override%0A    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) %7B%0A        inflater.inflate(R.menu.manageid_menu, menu);%0A    %7D%0A%0A    @Override%0A    public boolean onOptionsItemSelected(MenuItem item) %7B%0A        final int id = item.getItemId();%0A%0A        switch(id) %7B%0A            case R.id.action_add_item:%0A                AircraftDialog.showDialog(getActivity(), %22%22);%0A%0A                CustomAircraftDescriptorAdapter adapter = (CustomAircraftDescriptorAdapter) getListAdapter();%0A                adapter.notifyDataSetChanged();%0A%0A                break;%0A        %7D%0A%0A        return super.onOptionsItemSelected(item);%0A    %7D
 %0A%0A    @O

Add menu to ManageIDsFragment