Example usage for android.widget AbsListView equals

List of usage examples for android.widget AbsListView equals

Introduction

In this page you can find the example usage for android.widget AbsListView equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:net.reichholf.dreamdroid.fragment.ServiceListFragment.java

/**
 * @param l/* w  w  w . j a va 2s . co  m*/
 * @param v
 * @param position
 * @param id
 * @param isLong
 */
private void onListItemClick(AbsListView l, View v, int position, long id, boolean isLong) {
    @SuppressWarnings("unchecked")
    ExtendedHashMap item = new ExtendedHashMap((HashMap<String, Object>) l.getItemAtPosition(position));
    final String ref = item.getString(Event.KEY_SERVICE_REFERENCE);
    final String nam = item.getString(Event.KEY_SERVICE_NAME);
    if (Service.isBouquet(ref)) {
        if (l.equals(mNavList)) {
            // without FROM it's a "all" reference
            if (SERVICE_REF_ROOT.equals(mNavReference) && ref.toUpperCase().contains("FROM")) {
                ExtendedHashMap map = new ExtendedHashMap();
                map.put(Event.KEY_SERVICE_REFERENCE, String.valueOf(ref));
                map.put(Event.KEY_SERVICE_NAME, String.valueOf(nam));

                mHistory.add(map);
                mNavReference = ref;
                mNavName = nam;
                mNavList.setSelectionAfterHeaderView();
                reloadNav();
            } else {
                mDetailReference = ref;
                mDetailName = nam;
                //               mDetailList.setSelectionAfterHeaderView();
                reloadDetail(false);
            }
        }
        mBaseTitle = nam;
    } else { // It's a listitem in the servicelist
        if (mPickMode) {
            ExtendedHashMap map = new ExtendedHashMap();
            map.put(Event.KEY_SERVICE_REFERENCE, ref);
            map.put(Event.KEY_SERVICE_NAME, nam);

            Intent intent = new Intent();
            intent.putExtra(sData, (Serializable) map);
            finish(Activity.RESULT_OK, intent);
        } else {
            boolean instantZap = PreferenceManager.getDefaultSharedPreferences(getActionBarActivity())
                    .getBoolean("instant_zap", false);
            if ((instantZap && !isLong) || (!instantZap && isLong)) {
                zapTo(ref);
            } else {
                mCurrentService = item;
                showPopupMenu(v);
            }
        }
    }
}