Example usage for android.database Cursor equals

List of usage examples for android.database Cursor equals

Introduction

In this page you can find the example usage for android.database Cursor equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

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

Usage

From source file:com.binoy.vibhinna.VibhinnaFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    AdapterView.AdapterContextMenuInfo info;
    PropManager propmanager = new PropManager(getActivity().getApplicationContext());
    try {//from w w  w  . j av a2 s .  c  om
        // Casts the incoming data object into the type for AdapterView
        // objects.
        info = (AdapterView.AdapterContextMenuInfo) menuInfo;
    } catch (ClassCastException e) {
        // If the menu object can't be cast, logs an error.
        Log.w("Exception", "exception in getting menuinfo");
        return;
    }
    Cursor cursor = (Cursor) getListAdapter().getItem(info.position);
    String s1 = Constants.SD_PATH + propmanager.mbActivePath();
    String s2 = cursor.getString(7);
    if (cursor.equals(null) || s1.equals(s2))
        return;
    if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) {
        LayoutInflater headerInflater = (LayoutInflater) getSherlockActivity()
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        ViewGroup header = (ViewGroup) headerInflater.inflate(R.layout.context_menu_header, null);
        TextView title = (TextView) header.findViewById(R.id.context_menu_title);
        title.setText(cursor.getString(1));
        menu.setHeaderView(header);
    } else
        menu.setHeaderTitle(cursor.getString(1));
    android.view.MenuInflater inflater = getActivity().getMenuInflater();
    inflater.inflate(R.menu.context_menu, menu);
}