button clicked in one fragment action in anther fragment in android
===

Actually in my project when I click one `button1` in one fragment then it performs some operation in `onclick()`.  The problem is when I click another `button2` in another
fragment then also perform above operations (button1 operations)
What do I do to solve this?

     example
      class barfragment extends Fragment{

     button1.setonclicklistener(this);
      onclick(){
      FragmentTransaction ft=getFragmenetManager().beginTansction();


     }
      }
      class inframoation extends Fragment
         {
         BarFragment br=new BarFrgment();
          button2.setonclicklistner(br);
         }
is it work?
we get null pointer exception at  **ft**  when i click **button2**
but when iclick **button** then we dont get error
what is reson

