title: ListView itemId is always 0
body: <p>The value returned by id parameter of <code>setOnItemClickListener</code> is always <strong>0(zero)</strong> no matter which position i click on the value returned is always <strong>0</strong></p>
  
  <p>but the value of position of correct and i have also tried <code>adapterView.getItemIdAtPosition(i)</code> and still the value on clicking each item in list is <strong>zero</strong></p>
  
  <pre><code>public class ListFragment extends Fragment implements LoaderManager.LoaderCallbacks&lt;Cursor&gt;{
  
  ListView onlineList;
  FloatingActionButton onlineListFab;
  private static final int mLoaderId  = 1;
  ListAdapter listAdapter;
  
  public ListFragment() {
  
  }
  
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View v = inflater.inflate(R.layout.fragment_list, container, false);
      initilize(v);
      return v;
  }
  
  private void initilize(View v) {
      onlineList = (ListView)v.findViewById(R.id.onlineList);
      onlineListFab = (FloatingActionButton)v.findViewById(R.id.onlineListFab);
      onlineListFab.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              startActivity(new Intent(getActivity(),AddItem.class));
          }
      });
      listAdapter = new ListAdapter(getActivity(),null);
      onlineList.setAdapter(listAdapter);
      onlineList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
              Intent details = new Intent(getActivity(),AddItem.class);
              details.setData(Uri.withAppendedPath(TableName.mContentUri,String.valueOf(l)));
              Toast.makeText(getActivity(),l+"",Toast.LENGTH_SHORT).show();
              //startActivity(details);
          }
      });
      loadItems();
  }
  
  @Override
  public Loader&lt;Cursor&gt; onCreateLoader(int id, Bundle args) {
      switch (id){
          case mLoaderId:
              return new CursorLoader(getContext(), TableName.mContentUri,null,null,null,null);
      }
      return null;
  }
  
  @Override
  public void onLoadFinished(Loader&lt;Cursor&gt; loader, Cursor data) {
      listAdapter.swapCursor(data);
  }
  
  @Override
  public void onLoaderReset(Loader&lt;Cursor&gt; loader) {
      listAdapter.swapCursor(null);
  }
  
  private void loadItems() {
      if (getActivity().getSupportLoaderManager().getLoader(mLoaderId) == null) {
          getActivity().getSupportLoaderManager().initLoader(mLoaderId, null, this).forceLoad();
      } else {
          getActivity().getSupportLoaderManager().restartLoader(mLoaderId, null, this).forceLoad();
      }
  }
  }
  </code></pre>
  
  <p>AdapterCode :</p>
  
  <pre><code>public class ListAdapter extends CursorAdapter{
  
  
  public ListAdapter(Context context, Cursor c) {
      super(context, c);
  }
  
  
  @Override
  public View newView(Context context, Cursor cursor, ViewGroup parent) {
      View v = LayoutInflater.from(context).inflate(R.layout.item_layout,parent,false);
      return v;
  }
  
  @Override
  public void bindView(View view, Context context, Cursor cursor) {
      TextView name,price;
      name = (TextView)view.findViewById(R.id.itemName);
      price = (TextView)view.findViewById(R.id.itemPrice);
      name.setText(cursor.getString(cursor.getColumnIndex(TableName.table1.mName)));
      price.setText(String.valueOf(cursor.getInt(cursor.getColumnIndex(TableName.table1.mPrice))));
  }
  }
  </code></pre>