I am making an app in Android studio.My app has a tabbed activity with 3 layouts(tab1,tab2,tab3).I want to add some imageButton in 'tab1' and hence the following code:

```
public class tab1 extends Fragment{
private ImageView hom,home,homei;
private ImageButton img;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup 
container, @Nullable Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.tab1,container);
   // View innerView = v.findViewById(R.id.)
    hom=(ImageView) v.findViewById(R.id.hom);
    home=(ImageView) v.findViewById(R.id.home);
    homei=(ImageView) v.findViewById(R.id.homei);
    img=(ImageButton) v.findViewById(R.id.img);
    img.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(getContext(),"Experiment successful",Toast.LENGTH_SHORT).show();
        }
    });
    return inflater.inflate(R.layout.tab1,container,false);

}
}

```

There are no compilation errors but when I run the app,the imageButton is not responding.Please help me out.