title: Register Broadcast receiver in Fragment PageViewer
body: <p>I have previously asked a question in Stack for this and this is a continuing one for it </p>
  
  <p>Previous question </p>
  
  <p><a href="https://stackoverflow.com/questions/30206273/calling-fragment-from-inside-the-baseadapter-class-in-pageviewer-android">Calling Fragment from inside the BaseAdapter class in PageViewer Android</a></p>
  
  <p>Now I click on button .. it goes to register but can seem to call the Fragment .
  I think I need to register .</p>
  
  <p>How can I do it in manifest file for Fragment
  Below is my code for Broadcast receiver called within Adapterclass </p>
  
  <p>Code in Fragment class and this mBroadcastReceiver is passed to BaseAdapter class</p>
  
  <pre><code> mBroadcastReceiver = new BroadcastReceiver() {
                  @Override
                  public void onReceive(Context context, Intent intent) {
                      Toast.makeText(context, "Recived", 
                                 Toast.LENGTH_LONG).show();
                      FieldVisitFragment fieldvisitFragment = new FieldVisitFragment();
                      FragmentManager fragmentManager = getFragmentManager();
                      FragmentTransaction fragmentTransaction = fragmentManager
                              .beginTransaction();
                      fragmentTransaction.replace(android.R.id.tabcontent, fieldvisitFragment);
                      fragmentTransaction.commit();
                  }
  </code></pre>
  
  <p>Onclick of button within List from Adapter class</p>
  
  <p>I have added the code inside the BaseAdapter class</p>
  
  <pre><code>visitImg.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
                  Toast.makeText(con, "Visit Clicked ", Toast.LENGTH_LONG).show();
                  con.registerReceiver(mBroadcastReceiver, new IntentFilter(
                          "start.fragment.action"));
              }
          });
  </code></pre>
  
  <p>For Registration in Manifest file </p>
  
  <pre><code>  &lt;receiver android:name="what should I write here ???"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="start.fragment.action"/&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  </code></pre>
  
  <p>Changes done after seen in answer but still not working </p>
  
  <p>Manifest file </p>
  
  <pre><code>&lt;receiver android:name="companyname.appname.fragments.FragmentClassName$BroadT"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="start.fragment.action"/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>BroadT class  which is defined inside Fragment class</p>
  
  <pre><code>public class FragmentClassName extends Fragment
  </code></pre>
  
  <p>The BroadT class</p>
  
  <pre><code>class BroadT extends BroadcastReceiver
        {
            @Override
                  public void onReceive(Context context, Intent intent) {
                      Toast.makeText(context, "Recived", 
                                 Toast.LENGTH_LONG).show();
                      FieldVisitFragment fieldvisitFragment = new FieldVisitFragment();
                      FragmentManager fragmentManager = getFragmentManager();
                      FragmentTransaction fragmentTransaction = fragmentManager
                              .beginTransaction();
                      fragmentTransaction.replace(android.R.id.tabcontent, fieldvisitFragment);
                      fragmentTransaction.commit();
                  }
        }
  </code></pre>
  
  <p>My call in Base Adapter class </p>
  
  <pre><code>public void onClick(View arg0) {
                  Toast.makeText(con, "Visit Clicked ", Toast.LENGTH_LONG).show();
                  con.registerReceiver(mBroadcastReceiver, new IntentFilter(
                          "start.fragment.action"));
              }
  </code></pre>
  
  <p>But my  <code>&lt;receiver android:name="packagename.BroadT"&gt;</code> BroadT class does not seem to link to call the class </p>
  
  <p>I feel I need to use NESTED FRAGMENTS Can Anyone help ?</p>