LongClick not working on an empty gridview

view story

http://stackoverflow.com – Is it possible to handle longclick on an empty gridview or on an empty place of gridview? I tried to use code shown below: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GridView gridview = (GridView) findViewById(R.id.gridView1); gridview.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { Toast.makeText(MainActivity.this, "does it works?", Toast.LENGTH_SHORT).show(); return false; } }); } But, (HowTos)