Code example for GridView

Methods: setDrawSelectorOnTop, setId

0
		tv.setGravity(Gravity.CENTER);
		gframe.addView(tv, new FrameLayout.LayoutParams(
				ViewGroup.LayoutParams.FILL_PARENT,
				ViewGroup.LayoutParams.FILL_PARENT));
 
		GridView gv = new GridView(context);
		gv.setId(android.R.id.list);
		gv.setDrawSelectorOnTop(false);
		gframe.addView(gv, new FrameLayout.LayoutParams(
				ViewGroup.LayoutParams.FILL_PARENT,
				ViewGroup.LayoutParams.FILL_PARENT));
 
		root.addView(gframe, new FrameLayout.LayoutParams(
				ViewGroup.LayoutParams.FILL_PARENT,
				ViewGroup.LayoutParams.FILL_PARENT));
 
		// ------------------------------------------------------------------ 
 
		root.setLayoutParams(new FrameLayout.LayoutParams(
				ViewGroup.LayoutParams.FILL_PARENT,
				ViewGroup.LayoutParams.FILL_PARENT));