Your question is a bit simplified but I hope that the example below will be helpful:
public class MainActivity extends Activity implements OnClickListener, OnItemClickListener, OnItemLongClickListener {
....
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
.....
listView.setAdapter(adapter);
listView.setOnItemLongClickListener(this);
listView.setOnItemClickListener(this);
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
.....
}
@Override
public boolean onItemLongClick (AdapterView<?> parent, View item, int position, long id) {
....
}