コード例 #1
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   Log.d(TAG, "onActivityCreated");
   super.onActivityCreated(savedInstanceState);
   initAdapter();
   initListView();
 }
コード例 #2
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    // Always call the superclass so it can save the view hierarchy state
    super.onActivityCreated(savedInstanceState);

    getListView().setOnScrollListener(this);
  }
コード例 #3
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   adapter =
       new ArrayAdapter<String>(
           getActivity(), android.R.layout.simple_list_item_1, new ArrayList<String>());
   setListAdapter(adapter);
   if (task == null || task.getStatus() == MyAsyncTask.Status.FINISHED) {
     task = new DBTask();
     task.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
   }
   getListView()
       .setOnItemLongClickListener(
           new AdapterView.OnItemLongClickListener() {
             @Override
             public boolean onItemLongClick(
                 AdapterView<?> parent, View view, int position, long id) {
               String word = adapter.getItem(position);
               List<String> newWordList =
                   DatabaseManager.getInstance().removeAndGetNewFilterList(word);
               adapter.clear();
               adapter.addAll(newWordList);
               return true;
             }
           });
 }
コード例 #4
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // Populate list with our static array of titles.
    setListAdapter(
        new ArrayAdapter<String>(
            getActivity(), android.R.layout.simple_list_item_activated_1, FunctionsList.FUNCTIONS));

    // Check to see if we have a frame in which to embed the details
    // fragment directly in the containing UI.
    View detailsFrame = getActivity().findViewById(R.id.details);
    dual = detailsFrame != null && detailsFrame.getVisibility() == View.VISIBLE;

    if (savedInstanceState != null) {
      // Restore last state for checked position.
      position = savedInstanceState.getInt("currentChoice", 0);
    }

    if (dual) {
      // In dual-pane mode, the list view highlights the selected item.
      getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
      // Make sure our UI is in the correct state.
      showDetails(position);
    }
  }
コード例 #5
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    mAdapter = new EventListArrayAdapter(getActivity(), R.layout.event_list_item, R.id.eventText);

    AnimationSet set = new AnimationSet(true);

    Animation animation = new AlphaAnimation(0.0f, 1.0f);
    animation.setDuration(300);
    set.addAnimation(animation);
    animation =
        new TranslateAnimation(
            Animation.RELATIVE_TO_SELF,
            0.0f,
            Animation.RELATIVE_TO_SELF,
            0.0f,
            Animation.RELATIVE_TO_SELF,
            -1.0f,
            Animation.RELATIVE_TO_SELF,
            0.0f);
    animation.setDuration(300);
    set.addAnimation(animation);

    LayoutAnimationController controller = new LayoutAnimationController(set, 0.3f);
    getListView().setLayoutAnimation(controller);
    setListAdapter(mAdapter);
  }
コード例 #6
0
 @Override
 public void onActivityCreated(Bundle onSaveInstanceState) {
   super.onActivityCreated(onSaveInstanceState);
   setListAdapter(
       new ArrayAdapter(
           getActivity(), android.R.layout.simple_list_item_1, new String[] {"A", "B", "C", "D"}));
   ll = (OnClickLetterist) getActivity();
 }
コード例 #7
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   String[] values = new String[] {"New", "Open", "Waiting on user", "Closed"};
   ArrayAdapter<String> adapter =
       new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, values);
   setListAdapter(adapter);
 }
コード例 #8
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   Activity activity = getActivity();
   mNewLanguageField = (EditText) activity.findViewById(R.id.new_language);
   mLanguageChooser = (Spinner) activity.findViewById(R.id.current_language);
   mLanguageChooser.setOnItemSelectedListener(new OnLanguageChangedListener());
   activity.findViewById(R.id.translate_button).setOnClickListener(this);
 }
コード例 #9
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    setListAdapter(
        new ArrayAdapter<String>(
            getActivity(),
            android.R.layout.simple_list_item_1,
            getResources().getStringArray(R.array.SettingsListGcs)));
  }
コード例 #10
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    try {
      getFlights();
    } catch (Exception e) {
      log(e, getParentActivity());
    }
  }
コード例 #11
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    dialogCreate = new DialogCreate();
    dialogDismis = new DialogDismiss();
    failmsg = new FailMsg();
    handler = new Handler();

    threadList();
  }
コード例 #12
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    getListView().setDivider(null);

    Bundle args = new Bundle();
    args.putString(DataProvider.COL_CHATID, mListener.getProfileChatId());
    getLoaderManager().initLoader(0, args, this);
  }
コード例 #13
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    setRetainInstance(true);

    mgr = (SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE);
    adapter = new SensorListAdapter();

    setListAdapter(adapter);
  }
コード例 #14
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   String[] menu_items = getActivity().getResources().getStringArray(R.array.menu_items);
   int layout =
       (Build.VERSION.SDK_INT >= 11)
           ? android.R.layout.simple_list_item_activated_1
           : android.R.layout.simple_list_item_1;
   ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), layout, menu_items);
   setListAdapter(adapter);
 }
コード例 #15
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   String[] from = new String[] {CompanyTable.NAME};
   int[] to = new int[] {R.id.tv_company_item_without_button_name};
   db = DB.getInstance(MyDBHelper.getInstance(getActivity().getApplicationContext()));
   db.open();
   cursorAdapter = new CompanyCursorAdapter(getActivity().getApplicationContext(), null, 0, db);
   setListAdapter(cursorAdapter);
   db.companyCursorAdapter = cursorAdapter;
   getLoaderManager().initLoader(0, null, this);
 }
コード例 #16
0
ファイル: GistListFragment.java プロジェクト: numa08/gista
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mAdapter = new GistAdapter(getActivity());
    setListAdapter(mAdapter);
    setListShown(false);
    getLoaderManager().initLoader(0, null, this);

    if (getActivity() instanceof Gista) {
      Gista gista = (Gista) getActivity();
      getListView().setOnItemClickListener(gista);
      getListView().setOnItemLongClickListener(gista);
    }
  }
コード例 #17
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onActivityCreated(savedInstanceState);
    mAdapter = new AppListAdapter(getActivity());
    setListAdapter(mAdapter);

    // Start out with a progress indicator.
    setListShown(false);

    // Prepare the loader. Either re-connect with an existing one,
    // or start a new one.
    getLoaderManager().initLoader(0, null, this);
  }
コード例 #18
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   this.setListAdapter(
       new ArrayAdapter<String>(
           getActivity(),
           android.R.layout.simple_list_item_1,
           getResources().getStringArray(R.array.list_item))); // 使用静态数组填充列表
   if (savedInstanceState != null) {
     mCurCheckPosition = savedInstanceState.getInt("curChoice", 0);
     mShownCheckPosition = savedInstanceState.getInt("shownChoice", -1);
   }
   getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
   showDetails(mCurCheckPosition);
 }
コード例 #19
0
 @Override
 public void onActivityCreated(Bundle onSavedInstanceState) {
   super.onActivityCreated(onSavedInstanceState);
   if (megaListView != null) {
     View fragmentView = getView();
     TypedValue typedValue = new TypedValue();
     getActivity().getTheme().resolveAttribute(android.R.attr.colorBackground, typedValue, true);
     if (fragmentView != null) fragmentView.setBackgroundColor(typedValue.data);
     megaListView.setDividerHeight(0);
     if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
       megaListView.setSelector(R.drawable.abc_list_selector_disabled_holo_dark);
     megaListView.setFastScrollEnabled(true);
     megaListView.setDrawSelectorOnTop(true);
   }
 }
コード例 #20
0
  @Override
  public void onActivityCreated(Bundle _savedInstanceState) {
    super.onActivityCreated(_savedInstanceState);

    if (netCheck()) {
      InterfaceVehicles task = new InterfaceVehicles(this);
      task.execute();
    } else {
      Toast noNetwork =
          Toast.makeText(MainActivity.mContext, "Network Not Available!", Toast.LENGTH_SHORT);
      noNetwork.show();
      InterfaceVehicles task = new InterfaceVehicles(this);
      task.execute();
    }
  }
コード例 #21
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    adapter = new MenuAdapter(getActivity());
    adapter.add(new MenuItem(MENU_MESSAGES, 3 + ""));
    adapter.add(new MenuItem(MENU_GAMES, 28 + ""));
    adapter.add(new MenuItem(MENU_WARNINGS, 1 + ""));
    adapter.add(new MenuItem(MENU_PLAYERS, 155 + ""));
    adapter.add(new MenuItem(MENU_NEW_GAME, ""));
    adapter.add(new MenuItem(MENU_NEW_MESSAGE, ""));

    MenuItem logoutItem = new MenuItem("logout", "");
    logoutItem.setLoguot(true);
    adapter.add(logoutItem);

    setListAdapter(adapter);
  } // onActivityCreated()
コード例 #22
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    int layoutID = android.R.layout.simple_list_item_1;
    aa = new ArrayAdapter<Quake>(getActivity(), layoutID, earthquakes);
    setListAdapter(aa);

    Thread t =
        new Thread(
            new Runnable() {
              public void run() {
                refreshEarthquakes();
              }
            });
    t.start();
  }
コード例 #23
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    DragSortListView lv = (DragSortListView) getListView();
    lv.setDropListener(new ReportDropListener());

    adapter = new ArrayAdapter<>(getActivity(), R.layout.list_item_drag, android.R.id.text1);

    Preferences prefs = new Preferences(getActivity());
    reportClasses = prefs.getReportOrder();
    for (Class<? extends AbstractReport> reportClass : reportClasses) {
      AbstractReport report = AbstractReport.newInstance(reportClass, getActivity());
      adapter.add(report.getTitle());
    }

    setListAdapter(adapter);
  }
コード例 #24
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // ------------------------------------------------------------
    // https://stackoverflow.com/questions/21337717/listfragment-setlistadapter
    // ------------------------------------------------------------
    // if (listAdapter == null) {
    // listAdapter = new MyAdapter(getActivity());
    // }
    //
    // setListAdapter(listAdapter);
    // pbListLoading.setVisibility(View.VISIBLE);
    // ------------------------------------------------------------

    cargarLista();
    setListAdapter(new CustomAdapter());
  }
コード例 #25
0
  public void onActivityCreated(Bundle savedInstanceState) {

    super.onActivityCreated(savedInstanceState);

    menutitles = getResources().getStringArray(R.array.unit_title);
    menuIcons = getResources().obtainTypedArray(R.array.unit_icon);

    rowItems = new ArrayList<RowItem>();

    for (int i = 0; i < menutitles.length; i++) {
      RowItem items = new RowItem(menutitles[i], menuIcons.getResourceId(i, -1));

      rowItems.add(items);
    }

    adapter = new CustomAdapter(getActivity(), rowItems);
    setListAdapter(adapter);
    getListView().setOnItemClickListener(this);
  }
コード例 #26
0
ファイル: NewsListFragment.java プロジェクト: mayosuke/MyNews
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    Log.i(TAG, "onActivityCreated(savedInstanceState=" + savedInstanceState + ")");
    super.onActivityCreated(savedInstanceState);

    mText = new StringBuilder();
    setHasOptionsMenu(true);

    getListView().setFastScrollEnabled(true);
    final Bundle args = getArguments();
    final int categoryId = args.getInt(Constants.TAG_NEWS_CATEGORY_ID);
    if (categoryId == -1) {
      final String query = args.getString(Constants.TAG_NEWS_KEYWORD);
      getActivity().getActionBar().setTitle(query);
      loadXmlInBackground(query);
    } else {
      getActivity().getActionBar().setTitle(Constants.CATEGORIES[categoryId]);
      loadXmlInBackground(args.getInt(Constants.TAG_NEWS_CATEGORY_ID));
    }
  }
コード例 #27
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   if (savedInstanceState != null) {
     token = savedInstanceState.getString("token");
   }
   adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, result);
   setListAdapter(adapter);
   getListView()
       .setOnItemClickListener(
           new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
               Intent intent = new Intent();
               intent.putExtra("name", "@" + atList.get(position).getNickname() + " ");
               getActivity().setResult(Activity.RESULT_OK, intent);
               getActivity().finish();
             }
           });
 }
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    final Module module = mActivity.getModule();
    if (module == null) return;

    if (module.versions.isEmpty()) {
      setEmptyText(getString(R.string.download_no_versions));
      setListShown(true);
    } else {
      RepoLoader repoLoader = RepoLoader.getInstance();
      if (!repoLoader.isVersionShown(module.versions.get(0))) {
        TextView txtHeader = new TextView(getActivity());
        txtHeader.setText(R.string.download_test_version_not_shown);
        txtHeader.setTextColor(getResources().getColor(R.color.warning));
        txtHeader.setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                mActivity.gotoPage(DownloadDetailsActivity.DOWNLOAD_SETTINGS);
              }
            });
        getListView().addHeaderView(txtHeader);
      }

      sAdapter = new VersionsAdapter(mActivity, mActivity.getInstalledModule());
      for (ModuleVersion version : module.versions) {
        if (repoLoader.isVersionShown(version)) sAdapter.add(version);
      }
      setListAdapter(sAdapter);
    }

    DisplayMetrics metrics = getResources().getDisplayMetrics();
    int sixDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6, metrics);
    int eightDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, metrics);
    getListView().setDivider(null);
    getListView().setDividerHeight(sixDp);
    getListView().setPadding(eightDp, eightDp, eightDp, eightDp);
    getListView().setClipToPadding(false);
  }
コード例 #29
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   fillStations();
 }
コード例 #30
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    modoViagemDAO = new ModoViagemDAO(getActivity());

    String[] colunasDe = {
      BancoDeDados.MODOVIAGEM_COL_TIPO_MODO,
      BancoDeDados.MODOVIAGEM_COL_PARTIDA,
      BancoDeDados.MODOVIAGEM_COL_CHEGADA,
      BancoDeDados.MODOVIAGEM_COL_PARTIDA_DATA,
      BancoDeDados.MODOVIAGEM_COL_PARTIDA_HORA,
      BancoDeDados.MODOVIAGEM_COL_CHEGADA_DATA,
      BancoDeDados.MODOVIAGEM_COL_CHEGADA_HORA
    };
    int[] colunasPara = {R.id.tv_modo_detalhe, R.id.tv_modo_partida, R.id.tv_modo_chegada};

    simpleCursorAdapter =
        new SimpleCursorAdapter(
            getActivity(), R.layout.lista_modo_item, cursor, colunasDe, colunasPara, 0);
    setListAdapter(simpleCursorAdapter);

    simpleCursorAdapter.setViewBinder(
        new SimpleCursorAdapter.ViewBinder() {
          @Override
          public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
            if (columnIndex == cursor.getColumnIndex(BancoDeDados.MODOVIAGEM_COL_TIPO_MODO)) {
              String s =
                  Opcoes.modo_viagem[cursor.getInt(columnIndex)]
                      + ": "
                      + cursor.getString(cursor.getColumnIndex(BancoDeDados.MODOVIAGEM_COL_PARTIDA))
                      + " -> "
                      + cursor.getString(
                          cursor.getColumnIndex(BancoDeDados.MODOVIAGEM_COL_CHEGADA));
              ((TextView) view).setText(s);
              return true;
            }
            if (columnIndex == cursor.getColumnIndex(BancoDeDados.MODOVIAGEM_COL_PARTIDA)) {
              try {
                String s =
                    DateHandler.dateFormatDefault.format(
                            DateHandler.sdf.parse(
                                cursor.getString(
                                    cursor.getColumnIndex(
                                        BancoDeDados.MODOVIAGEM_COL_PARTIDA_DATA))))
                        + " "
                        + DateHandler.timeFormat.format(
                            DateHandler.sdf_time.parse(
                                cursor.getString(
                                    cursor.getColumnIndex(
                                        BancoDeDados.MODOVIAGEM_COL_PARTIDA_HORA))));
                ((TextView) view).setText(getResources().getString(R.string.tv_partida) + ": " + s);
              } catch (ParseException e) {
                e.printStackTrace();
              }
              return true;
            }
            if (columnIndex == cursor.getColumnIndex(BancoDeDados.MODOVIAGEM_COL_CHEGADA)) {
              try {
                String s =
                    DateHandler.dateFormatDefault.format(
                            DateHandler.sdf.parse(
                                cursor.getString(
                                    cursor.getColumnIndex(
                                        BancoDeDados.MODOVIAGEM_COL_CHEGADA_DATA))))
                        + " "
                        + DateHandler.timeFormat.format(
                            DateHandler.sdf_time.parse(
                                cursor.getString(
                                    cursor.getColumnIndex(
                                        BancoDeDados.MODOVIAGEM_COL_CHEGADA_HORA))));
                ((TextView) view).setText(getResources().getString(R.string.tv_chegada) + ": " + s);
              } catch (ParseException e) {
                e.printStackTrace();
              }
              return true;
            }
            return false;
          }
        });

    AdapterView.OnItemLongClickListener longClickListener =
        new AdapterView.OnItemLongClickListener() {
          @Override
          public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            if (mActionMode != null) {
              return false;
            }
            id_selecionado = id;
            position_selecionado = position;
            getListView().setItemChecked(position, true);
            mActionMode = getActivity().startActionMode(mAntionModeCallback);
            return true;
          }
        };

    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    getListView().setOnItemLongClickListener(longClickListener);
  }