registerForContextMenu(View view) question


#1

On page 285, we register the crime list view for a floating context menu by instantiating a new ListView object called listView. Why not simply register the view v which we are creating in the onCreateView() method in the first place. IE, instead of:

ListView listView = (ListView)v.findViewById(android.R.id.list);
registerForContextMenu(listView);

just do

registerForContextMenu(v);

Thanks!
-Andy