@Override public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { if (parent.getId() == R.id.category) { mPosition = pos; } else { EntryHolder eh = (EntryHolder) parent.getTag(); int type = pos + 1; eh.mEntryItem.mType = type; eh.mValueField.setInputType(INPUT_TYPES[type]); if (type == AccountManager.EntryType.PASSWORD || type == AccountManager.EntryType.PIN) { eh.mAutoPwd.setVisibility(View.VISIBLE); } else { eh.mAutoPwd.setVisibility(View.INVISIBLE); } } }
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Log.e(TAG, "onItemSelected: " + position + ", tag:" + parent.getTag()); String url = aboutLinksUrls[position]; switch (position) { case 0: // Help case 1: // Send feedback startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); break; case 2: // Tell a friend about Lokki openTellAFriendActivity(); break; } }
// @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { /*---------------------------- * Steps * 1. Get tag * 2. Vibrate * 3. Switching ----------------------------*/ Methods.DialogItemTags tag = (Methods.DialogItemTags) parent.getTag(); vib.vibrate(Methods.vibLength_click); /*---------------------------- * 3. Switching ----------------------------*/ switch (tag) { } // switch (tag) } // public void onItemClick(AdapterView<?> parent, View v, int position, long id)
// @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { /*---------------------------- * Steps * 1. Get tag * 2. Vibrate * 3. Switching ----------------------------*/ Methods.DialogItemTags tag = (Methods.DialogItemTags) parent.getTag(); // vib.vibrate(Methods.vibLength_click); /*---------------------------- * 3. Switching ----------------------------*/ switch (tag) { case dlg_move_files: // ---------------------------------------------- String folderPath = (String) parent.getItemAtPosition(position); Methods.dlg_confirm_moveFiles(actv, dlg, folderPath); // // debug // Toast.makeText(actv, "Move files to: " + folderPath, 2000) // .show(); break; // case dlg_move_files case dlg_add_memos_gv: // ---------------------------------------------- String word = (String) parent.getItemAtPosition(position); Methods.add_pattern_to_text(dlg, position, word); // String word = (String) parent.getItemAtPosition(position); // // EditText et = (EditText) dlg.findViewById(R.id.dlg_add_memos_et_content); // // String content = et.getText().toString(); // // content += word + " "; // // et.setText(content); // // et.setSelection(et.getText().toString().length()); // // debug // Toast.makeText(actv, word, 2000).show(); break; case dlg_db_admin_lv: // ---------------------------------------------- /*---------------------------- * 1. Get chosen item name * 2. Switching ----------------------------*/ String item = (String) parent.getItemAtPosition(position); // // debug // Toast.makeText(actv, item, 2000).show(); /*---------------------------- * 2. Switching ----------------------------*/ if (item.equals(actv.getString(R.string.dlg_db_admin_item_backup_db))) { Methods.db_backup(actv, dlg); } else if (item.equals(actv.getString(R.string.dlg_db_admin_item_refresh_db))) { RefreshDBTask task_ = new RefreshDBTask(actv, dlg); // debug Toast.makeText(actv, "Starting a task...", 2000).show(); task_.execute("Start"); dlg.dismiss(); // // Log // Log.d("DialogOnItemClickListener.java" // + "[" // + Thread.currentThread().getStackTrace()[2] // .getLineNumber() + "]", "DB refresh"); // Methods.refreshMainDB(actv, dlg); } break; // case dlg_add_memos_gv case dlg_admin_patterns_lv: // ---------------------------------------------- /*---------------------------- * 1. Get chosen item name * 2. Switching ----------------------------*/ item = (String) parent.getItemAtPosition(position); // // debug // Toast.makeText(actv, item, 2000).show(); /*---------------------------- * 2. Switching ----------------------------*/ if (item.equals(actv.getString(R.string.generic_tv_register))) { Methods.dlg_register_patterns(actv, dlg); } else if (item.equals(actv.getString(R.string.generic_tv_delete))) { Methods.dlg_delete_patterns(actv, dlg); } else if (item.equals(actv.getString(R.string.generic_tv_edit))) { } break; // case dlg_admin_patterns_lv case dlg_delete_patterns_gv: // ---------------------------------------------- item = (String) parent.getItemAtPosition(position); // // debug // Toast.makeText(actv, item, 2000).show(); Methods.dlg_confirm_delete_patterns(actv, dlg, dlg2, item); break; // case dlg_delete_patterns_gv default: break; } // switch (tag) } // public void onItemClick(AdapterView<?> parent, View v, int position, long id)
/* * Process single item click for the listviews * * (non-Javadoc) * * @see * android.widget.AdapterView.OnItemClickListener#onItemClick(android.widget * .AdapterView, android.view.View, int, long) */ public void onItemClick(AdapterView<?> av, View view, int position, long arg) { String tag = (String) av.getTag(); if (tag == "ayahList") { onAyahListItemClick(view, position); } }
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (((String) parent.getTag()).compareTo("filter") == 0) { mBroadcaster.applyFilter(position); } }