title: how to use send broadcast method in fragment class
body: <p>I need a little bit of help.  I'm trying on the gps on a mobile.  No idea whether that works or not but before that I have set onclicklistener for the button but it does not allow to have sendbroadcast.  Anyone have solution for this?</p>
  
  <pre><code>public class locate extends Fragment {
      Button b1;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
  
      View rootView = inflater.inflate(R.layout.locate, container, false);
      onCreate(savedInstanceState);
      b1=(Button)rootView.findViewById(R.id.widget33);
      b1.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View arg0) {
              // TODO Auto-generated method stub
              Toast.makeText(Gloabal.getcontext(), "text", Toast.LENGTH_LONG).show();
              Intent intent=new Intent("android.location.GPS_ENABLED_CHANGE");
              intent.putExtra("enabled", true);
              sendBroadcast(intent);
              //startActivity(intent);
          }
      });
      return rootView;
  
  }
  
  }
  </code></pre>
  
  <p>any other alternative to use the intent ...m stuck a bit as m using swipeable tabs so dono much around that,any help is much appreciated</p>