In fragments we need a view of that window so that we make a onCreateView of this Fragment.
Then get the view and use it to access each and every view id of that view elements..
class Demo extends Fragment
{
@Override
public View onCreateView(final LayoutInflater inflater,ViewGroup container, Bundle savedInstanceState)
{
View view =inflater.inflate(R.layout.demo_fragment, container,false);
ImageView imageview=(ImageView)view.findViewById(R.id.imageview1);
return view;
}
}