Example #1
0
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.list_fragment, container, false);

    if (dbHelper == null) {
      dbHelper = DBHelper.getInstance(getActivity());
    }

    gridView = (GridView) view.findViewById(R.id.grid_view);
    gridView.setOnItemClickListener(onClickListener);

    //  gridView.setFastScrollEnabled(true);
    //  gridView.setFastScrollAlwaysVisible(true);

    gridView.setAdapter(adapter);

    hiddenCreateView = (CreateView) view.findViewById(R.id.create_alliance);
    hiddenCreateView.setVisibility(View.GONE);
    hiddenCreateView.setElevation(16);

    Button button = (Button) hiddenCreateView.findViewById(R.id.list_create);
    button.setTypeface(DemoActivity.getFont());

    new LoadCursors().execute("");

    return view;
  }
Example #2
0
  private Cursor getCursor(int type) {

    switch (type) {
      case MY_ALLIANCES:
        return dbHelper.getAlliances();
    }
    return null;
  }
Example #3
0
 public void refreshAdapter() {
   if (adapter != null) {
     switch (type) {
       case MY_ALLIANCES:
         adapter.changeCursor(dbHelper.getAlliances());
         break;
     }
   }
 }
Example #4
0
    @Override
    protected String doInBackground(String... params) {

      if (dbHelper == null) {
        dbHelper = DBHelper.getInstance(getActivity());
      }

      cursor = getCursor(type);
      return null;
    }