コード例 #1
0
 @Override
 public void onListItemClick(ListView l, View v, int position, long id) {
   super.onListItemClick(l, v, position, id);
   Intent intent = new Intent(getActivity(), MainActivity.class);
   intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
   startActivity(intent);
 }
コード例 #2
0
 @Override
 public void onListItemClick(ListView listView, View view, int position, long id) {
   super.onListItemClick(listView, view, position, id);
   // 发送列表项点击事件,直接使用getItem,这里是DummyItem类型
   Log.d(MainActivity.TAG, "Clicked item:" + position);
   EventBus.getDefault().post(getListView().getItemAtPosition(position));
 }
コード例 #3
0
 @Override
 public void onListItemClick(ListView listView, View view, int position, long id) {
   super.onListItemClick(listView, view, position, id);
   // Notify the active callbacks interface (the activity, if the
   // fragment is attached to one) that an item has been selected.
   mCallbacks.onItemSelected(mArtistsList.get(position).Name);
 }
コード例 #4
0
  @Override
  public void onListItemClick(ListView l, View v, final int position, long id) {
    super.onListItemClick(l, v, position, id);
    // Want to send request to join the group!

    Group group = new Group();
    group.setApproved(false); // needs approval
    group.setGroupName(aUsers.get(position));
    group.setNameOfClass(mCurrentClass);
    group.setMembers(mCurrentUser);
    group.setCreator("alreadyCreated");
    group.saveInBackground(
        new SaveCallback() {
          @Override
          public void done(ParseException e) {
            if (e == null) {
              Log.v(TAG, "Group saved!");
              Toast.makeText(
                      getActivity(),
                      "A request to join group " + aUsers.get(position) + " was made.",
                      Toast.LENGTH_LONG)
                  .show();
              ((MainActivity) getActivity()).queryUnapproved();
            } else {
              Log.e(TAG, "There was an error requesting a group ");
            }
          }
        });
  }
コード例 #5
0
ファイル: InboxFragment.java プロジェクト: harry329/Ribbitt
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    ParseObject message = mMessages.get(position);
    String messageType = message.getString(ParseConstant.KEY_FILE_TYPE);
    ParseFile file = message.getParseFile(ParseConstant.KEY_FILE);
    Uri fileUri = Uri.parse(file.getUrl());

    if (messageType.equals(ParseConstant.TYPE_IMAGE)) {
      Intent intent = new Intent(getActivity(), ViewimageActivity.class);
      intent.setData(fileUri);
      startActivity(intent);
    } else {
      Intent intent = new Intent(Intent.ACTION_VIEW, fileUri);
      intent.setDataAndType(fileUri, "video/*");
      startActivity(intent);
    }

    // Delete it
    List<String> ids = message.getList(ParseConstant.KEY_RECIPIENT_IDS);
    if (ids.size() == 1) {
      // last recipients
      message.deleteInBackground();
    } else {
      ids.remove(ParseUser.getCurrentUser().getObjectId());
      ArrayList<String> idsToRemove = new ArrayList<String>();
      idsToRemove.add(ParseUser.getCurrentUser().getObjectId());

      message.removeAll(ParseConstant.KEY_RECIPIENT_IDS, idsToRemove);
      message.saveInBackground();
    }
  }
コード例 #6
0
 @Override
 public void onListItemClick(ListView l, View v, int position, long id) {
   super.onListItemClick(l, v, position, id);
   Intent intent = new Intent(getActivity(), RestaurantDetail.class);
   intent.putExtra("restaurant", listStore.get(position - 1));
   startActivity(intent);
 }
コード例 #7
0
 @Override
 public void onListItemClick(ListView l, View v, int position, long id) {
   super.onListItemClick(l, v, position, id);
   Intent intent = new Intent(getActivity().getApplicationContext(), OrderDetailActivity.class);
   intent.putExtra(EXTRA_MESSAGE, id);
   startActivity(intent);
 }
コード例 #8
0
ファイル: MainActivity.java プロジェクト: upnextapp/Android
 @Override
 public void onListItemClick(ListView l, View v, int position, long id) {
   super.onListItemClick(l, v, position, id);
   QueueDialogFragment qdf = new QueueDialogFragment();
   qdf.setRestaurantName(restaurantsArrayList.get(position));
   qdf.setQueue(queue);
   qdf.show(getActivity().getFragmentManager(), "Queue Prompt");
 }
コード例 #9
0
ファイル: titlefrag.java プロジェクト: JimSeker/ui
  @Override
  public void onListItemClick(ListView listView, View view, int position, long id) {
    super.onListItemClick(listView, view, position, id);

    // Notify the active callbacks interface (the activity, if the
    // fragment is attached to one) that an item has been selected.
    if (mListener != null) mListener.onItemSelected(position);
  }
コード例 #10
0
 @Override
 public void onListItemClick(ListView listView, View view, int position, long id) {
   super.onListItemClick(listView, view, position, id);
   // Notify the active callbacks interface (the activity, if the
   // fragment is attached to one) that an item has been selected.
   MappingStage selectedStage = mStageArrayAdapter.getItem(position);
   mCallbacks.onItemSelected(selectedStage.getCode());
 }
コード例 #11
0
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    Intent intent = new Intent(getActivity(), ExhibitDetailActivity.class);
    intent.putExtra(ExhibitDetailActivity.EXTRA_ANIMAL, mAdapter.getItem(position));

    startActivity(intent);
  }
コード例 #12
0
  /*
   * (non-Javadoc)
   *
   * @see android.app.ListFragment#onListItemClick(android.widget.ListView,
   * android.view.View, int, long)
   */
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    if (null != countrySelectedListener) {
      countrySelectedListener.onCountrySelected(position);
    }
  }
コード例 #13
0
  /** {@inheritDoc} */
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    final Cosplayer item = mAdapter.getItem(position);
    final Intent intent =
        new Intent(getActivity(), DetailActivity.class).putExtra(DetailActivity.ARG_ITEM, item);
    getActivity().startActivity(intent);
  }
コード例 #14
0
 @Override
 public void onListItemClick(ListView l, View v, int position, long id) {
   super.onListItemClick(l, v, position, id);
   log.v(this, "onListItemClick(pos:" + position + "|id:" + id);
   Message message = Message.obtain();
   message.what = Constant.WHAT_SELECT_VERSE;
   message.obj = v.getTag();
   controller.executeMessage(message);
 }
コード例 #15
0
  @Override
  public void onListItemClick(ListView listView, View view, int position, long id) {
    super.onListItemClick(listView, view, position, id);

    // Notify the active callbacks interface (the activity, if the
    // fragment is attached to one) that an item has been selected.
    // mCallbacks.onItemSelected(DummyContent.ITEMS.get(position).id);
    mCallbacks.onItemSelected(String.valueOf(position + 1));
  }
コード例 #16
0
  /**
   * From Android Develop Documentation:
   *
   * <p>This method will be called when an item in the list is selected. Subclasses should override.
   * Subclasses can call getListView().getItemAtPosition(position) if they need to access the data
   * associated with the selected item.
   *
   * <p>Parameters l The ListView where the click happened v The view that was clicked within the
   * ListView position The position of the view in the list id The row id of the item that was
   * clicked
   */
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    // Calls super.
    super.onListItemClick(l, v, position, id);

    mPosition = position;
    Segment segment = (Segment) (getListView().getItemAtPosition(position));
    mSelectedCallback.onSegmentSelected(segment);
  }
コード例 #17
0
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    long contactId = (Long) v.getTag(R.id.tag_id);

    Intent in = new Intent(getActivity(), ProfileActivity.class);
    in.putExtra(CANTACT_ID, contactId);
    getActivity().startActivity(in);
  }
コード例 #18
0
    @Override
    public void onListItemClick(ListView listView, View view, int position, long id) {
      super.onListItemClick(listView, view, position, id);

      Object o = this.getListAdapter().getItem(position);
      String testName = o.toString();
      if (activity != null) {
        activity.onTestSelected(testName);
      }
    }
コード例 #19
0
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    ModelAdapter<Video> videoAdapter = getModelAdapter();
    Video video = videoAdapter.getItem(position);

    playVideo(video, position);
    // play video at index
  }
コード例 #20
0
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {

    String phoneNumber = mMyCursorAdapter.getItem(position);

    Intent intent = new Intent(Intent.ACTION_CALL);
    intent.setData(Uri.parse("tel:" + phoneNumber));
    startActivity(intent);

    super.onListItemClick(l, v, position, id);
  }
コード例 #21
0
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    Livro livro = livros.get(position);

    // Notify the parent activity of selected item
    mCallback.onLivroSelected(position, livro.getId());

    // Set the item as checked to be highlighted when in two-pane layout
    getListView().setItemChecked(position, true);
  }
コード例 #22
0
  /** Metodo que se llama cuando se selecciona a un empleado o empresa de la lista. */
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    String idString = String.valueOf(id);

    if (l.getId() == android.R.id.list) {
      onEmpleadoSelected(idString);
    } else if (l.getId() == R.id.listEmpresas) {
      onEmpresaSelected(idString);
    }
  }
  @Override
  public void onListItemClick(ListView listView, View view, int position, long id) {
    super.onListItemClick(listView, view, position, id);

    // Notify the active callbacks interface (the activity, if the
    // fragment is attached to one) that an item has been selected.

    Receta receta = (Receta) listView.getAdapter().getItem(position);
    Toast.makeText(getContext(), receta.getNombre(), Toast.LENGTH_LONG).show();

    mCallbacks.onItemSelected(receta);
  }
コード例 #24
0
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {

    Crime crime = ((CrimeAdapter) getListAdapter()).getItem(position);

    //        Intent intent = new Intent(getActivity(),CrimeActivity.class);
    Intent intent = new Intent(getActivity(), CrimePagerActivity.class);
    intent.putExtra(CrimeFragment.EXTRA_CRIME_ID, crime.getId());
    startActivity(intent);

    super.onListItemClick(l, v, position, id);
  }
コード例 #25
0
 @Override
 public void onListItemClick(ListView l, View v, int position, long id) {
   // TODO Auto-generated method stub
   super.onListItemClick(l, v, position, id);
   Log.v(MainActivity.SECOND_KEY, this.getClass().getName() + "clicking and creating intent");
   Intent intent = new Intent(getActivity(), RecipeActivity.class);
   Log.v(MainActivity.SECOND_KEY, this.getClass().getName() + " created intent");
   intent.putExtra(MainActivity.EXTRA_RECIPE, recipes.get(position));
   Log.v(MainActivity.SECOND_KEY, this.getClass().getName() + " passed and extra");
   startActivityForResult(intent, MainActivity.RECIPE_REQUEST_CODE);
   Log.v(MainActivity.SECOND_KEY, this.getClass().getName() + "creating intent end");
 }
コード例 #26
0
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    if (null != mListener) {
      // Notify the active callbacks interface (the activity, if the
      // fragment is attached to one) that an item has been selected.
      Item objectItem = data.get(position);

      mListener.onFragmentInteraction(objectItem.id);
    }
  }
コード例 #27
0
 // Selected and deselect items and edit appropriate fragments
 public void onListItemClick(ListView l, View v, int position, long id) {
   super.onListItemClick(l, v, position, id);
   RadioButton routeSelected = (RadioButton) v.findViewById(R.id.radioButton1);
   ((MainActivity) getActivity()).routeElement = position;
   if (!routeSelected.isChecked()) {
     routeSelected.setChecked(true);
     adapter.setPositionSelected(((MainActivity) getActivity()).routeElement);
     ((MainActivity) getActivity()).setRoute(adapter.getRouteSelected());
     ((MainActivity) getActivity()).selectedTrails =
         ((MainActivity) getActivity()).getAllRouteTrails(adapter.getRouteSelected());
   }
   mSectionsPagerAdapter.notifyDataSetChanged();
 }
コード例 #28
0
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    Exercise selectedExercise = (Exercise) getListAdapter().getItem(position);
    DataManager.getCurrentPatient().setSelectedExercise(selectedExercise);

    getFragmentManager()
        .beginTransaction()
        .replace(R.id.fragment_container, new VideoFragment())
        .addToBackStack(null)
        .commit();
  }
コード例 #29
0
  @Override
  public void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    if (null != mListener) {
      mCursor.moveToPosition(position);
      Playlist playlist =
          new Playlist(
              mCursor.getLong(PlaylistLoader.Query._ID),
              mCursor.getString(PlaylistLoader.Query.TITLE));
      mListener.onPlaylistsFragmentInteraction(playlist, false);
    }
  }
コード例 #30
0
  @Override
  public void onListItemClick(ListView listView, View view, int position, long id) {
    super.onListItemClick(listView, view, position, id);

    // Notify the active callbacks interface (the activity, if the
    // fragment is attached to one) that an item has been selected.
    if (Cache.provider == null) return;

    LocationArrayAdapter.Union union =
        (LocationArrayAdapter.Union) listView.getAdapter().getItem(position);
    if (union.room == null) return; // weird muckery going on here...

    mCallbacks.onItemSelected(Long.toString(union.room.id));
  }