@Override
 public void onItemClick(
     final AdapterView<?> parent, final View view, final int position, final long id) {
   final ListView lv = (ListView) parent;
   final Payload payload = (Payload) lv.getAdapter().getItem(position);
   if (payload.intentable()) {
     parent.getContext().startActivity(payload.toIntent(parent.getContext()));
   } else if (!this.clickListener.payloadClicked(payload)) {
     Toast.makeText(
             parent.getContext(),
             "Do not know how to show: " + payload.getTitle(),
             Toast.LENGTH_LONG)
         .show();
   }
 }
 @Override
 public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
   Toast.makeText(parent.getContext(), "clicked!", Toast.LENGTH_LONG);
   Log.d("see", "clicked!");
   if (parent.getId() == R.id.location_spinner) {
     subLoc_spinner.setVisibility(View.VISIBLE);
     Toast.makeText(parent.getContext(), "clicked!", Toast.LENGTH_LONG);
     Log.d("see", "clicked!!");
   }
   if (parent.getId() == R.id.sublocation_spinner) {
     submit_btn.setEnabled(true);
     submit_btn.setVisibility(View.VISIBLE);
     Log.d("see", "clicked!!");
   }
 }
  /* (non-Javadoc)
   * @see android.widget.AdapterView.OnItemSelectedListener#onItemSelected(android.widget.AdapterView, android.view.View, int, long)
   */
  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {

    Toast.makeText(
            parent.getContext(),
            "OnItemSelectedListener : " + parent.getItemAtPosition(pos).toString(),
            Toast.LENGTH_SHORT)
        .show();
  }
Example #4
0
 @Override
 public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
   Toast.makeText(
           parent.getContext(),
           "Percentage selected is " + parent.getItemAtPosition(pos).toString(),
           Toast.LENGTH_LONG)
       .show();
 }
  // WHAT WE SELECTED IN SPINNER
  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
    // On selecting a spinner item
    item = parent.getItemAtPosition(pos).toString();

    // Showing selected spinner item
    Toast.makeText(parent.getContext(), "Selected: " + item, Toast.LENGTH_SHORT).show();

    // send to database entry
  }
Example #6
0
  @Override
  public void onItemClick(AdapterView<?> adapter, View view, int position, long id) {

    Goal item = adapterGoal.getItem(position);

    Intent intent = new Intent(adapter.getContext(), EditGoalActivity.class);

    intent.putExtra("Goal", item);

    startActivityForResult(intent, R.layout.view_edit_goal);
  }
  @Override
  public boolean onItemLongClick(AdapterView<?> av, View v, int position, long arg3) {

    AlertDialog.Builder builder = new AlertDialog.Builder(av.getContext());

    builder.setMessage(ac.getString(R.string.delete) + " ?");
    builder.setPositiveButton(R.string.yes, new YesDelListener(ac, av, position));
    builder.setNegativeButton(R.string.no, null);

    builder.create();
    builder.show();
    return false;
  }
 public int findIndexOfItemContainingText(String targetText) {
   for (int i = 0; i < realAdapterView.getCount(); i++) {
     View childView =
         realAdapterView
             .getAdapter()
             .getView(i, null, new FrameLayout(realAdapterView.getContext()));
     String innerText = shadowOf(childView).innerText();
     if (innerText.contains(targetText)) {
       return i;
     }
   }
   return -1;
 }
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    final ListView list = (ListView) parent;
    final int headerCount = list.getHeaderViewsCount();

    if (position < headerCount) {
      // The click is on a header, don't do anything.
      return;
    }

    // Absolute position for the adapter.
    position -= headerCount;

    final BookmarksListAdapter adapter = getBookmarksListAdapter();
    if (adapter.isShowingChildFolder()) {
      if (position == 0) {
        // If we tap on an opened folder, move back to parent folder.
        adapter.moveToParentFolder();
        return;
      }

      // Accounting for the folder view.
      position--;
    }

    final Cursor cursor = adapter.getCursor();
    if (cursor == null) {
      return;
    }

    cursor.moveToPosition(position);

    int type = cursor.getInt(cursor.getColumnIndexOrThrow(Bookmarks.TYPE));
    if (type == Bookmarks.TYPE_FOLDER) {
      // If we're clicking on a folder, update adapter to move to that folder
      final int folderId = cursor.getInt(cursor.getColumnIndexOrThrow(Bookmarks._ID));
      final String folderTitle = adapter.getFolderTitle(parent.getContext(), cursor);
      adapter.moveToChildFolder(folderId, folderTitle);
    } else {
      // Otherwise, just open the URL
      final String url = cursor.getString(cursor.getColumnIndexOrThrow(URLColumns.URL));

      // This item is a TwoLinePageRow, so we allow switch-to-tab.
      getOnUrlOpenListener()
          .onUrlOpen(url, EnumSet.of(OnUrlOpenListener.Flags.ALLOW_SWITCH_TO_TAB));
    }
  }
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    Intent intentProfile = new Intent(parent.getContext(), view.getClass());
    intentProfile.putExtra("luc", "yo");

    startActivity(intentProfile);
  }
 @Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   ILog.d(VIEW_LOG_TAG, "context " + parent.getContext());
   Category item = (Category) parent.getItemAtPosition(position);
   ActivityUtil.gotoCategoryAppListActivity(getContext(), item);
 }
Example #12
0
 @Override
 public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
   String item = parent.getItemAtPosition(position).toString();
   Toast.makeText(parent.getContext(), item, Toast.LENGTH_LONG);
 }