title: Tab Activity not working for startActivityforResult()
body: <p>I have <code>NewMessage Activity</code> from which I am calling Tab Activity. Tab Activity Contains 3 Tab <code>Contacts|Group|Selected Contacts</code> I will select some contacts on contact tab and will redirect those contacts to <code>NewMessage</code> again. This thing is working fine without Tab Activity. </p>
  
  <p>I refer some link</p>
  
  <p><a href="https://stackoverflow.com/questions/6677466/stuck-with-getting-camera-pic-when-using-the-tab-activity/6679665#6679665">stuck with getting camera pic when using the tab Activity</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4510280/android-onactivityresult-is-always-0">Android onActivityResult is always 0</a></p>
  
  <p><a href="https://stackoverflow.com/questions/11739370/onactivityresult-is-never-called-in-tabactivity">On Activity never calls</a></p>
  
  <p>My Code:</p>
  
  <blockquote>
    <p>To Call The Tab Activity</p>
  </blockquote>
  
  <pre><code>Intent i = new Intent(this,Tab.class);
  startActivityForResult(i, REQUEST_PICK_CONTACT);
  </code></pre>
  
  <blockquote>
    <p>Tab.Class</p>
  </blockquote>
  
  <pre><code>public class Tab extends TabActivity {
      /** Called when the activity is first created. */
      @SuppressLint("NewApi")
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.tab);
          android.app.ActionBar actionBar = getActionBar();
          actionBar.setHomeButtonEnabled(false);
          actionBar.setDisplayHomeAsUpEnabled(false);
  
          TabHost tabHost = getTabHost();
  
          // Tab for Photos
          TabSpec PhoneBook = tabHost.newTabSpec("PhoneBook");
          PhoneBook.setIndicator("PhoneBook");
          Intent PhoneBook = new Intent(this, Tab1.class);
          PhoneBook.setContent(photosIntent);
  
          // Tab for Songs
          TabSpec Groups = tabHost.newTabSpec("Groups");
          // setting Title and Icon for the Tab
          Groups.setIndicator("Groups");
          Intent Groups = new Intent(this, Tab2.class);
          Groups.setContent(Groups);
  
          // Tab for Videos
          TabSpec SelectedContacts = tabHost.newTabSpec("Selected Contacts");
          SelectedContacts.setIndicator("Selected Contacts");
          Intent SelectedContacts = new Intent(this, Tab3.class);
          SelectedContacts.setContent(videosIntent);
  
          // Adding all TabSpec to TabHost
          tabHost.addTab(PhoneBook); // Adding PhoneBook
          tabHost.addTab(Groups); // Adding Group PhoneBook
          tabHost.addTab(SelectedContacts); // Adding SelectedContacts
      }
      //Menu Bar
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater inflater = getMenuInflater();       
            inflater.inflate(R.menu.contact_list, menu);
            return super.onCreateOptionsMenu(menu);//This is actionBar Save Button
      }
      public boolean onOptionsItemSelected(MenuItem item) {
          int id = item.getItemId();   
          //Save Button Click
          if (id == R.id.action_done) 
          {
              Log.d("Activity","Tab");
  
          }
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <blockquote>
    <p>This is the Tab1.Class From which I need to pass on value ActionBar Save Button Click.</p>
  </blockquote>
  
  <p>I have declare action_bar save button in Tab.Class because if I declare it in Tab1.class its not showing up.This is the code which I return back on save button Click</p>
  
  <pre><code>public boolean onOptionsItemSelected(MenuItem item) {
      int id = item.getItemId();   
      //Save Button Click
      if (id == R.id.action_done) 
      {
          for(int i = 0; i &lt; ViewContactName.size(); i++)
  
          {
          if(ma.mCheckStates.get(i)==true)
          {
            SelectedName.add(ViewContactName.get(i));
            SelectedPhoneNumber.add(ViewContatcPhnoeNo.get(i).replaceAll("[^0-9,+]", ""));
          }
      }
      Intent intent = new Intent();
      intent.putStringArrayListExtra("ContactName",(ArrayList&lt;String&gt;) SelectedName);
      intent.putStringArrayListExtra("ContactNumber", (ArrayList&lt;String&gt;) SelectedPhoneNumber);
      setResult(RESULT_OK, intent);
      finish();
  
      }
      return super.onOptionsItemSelected(item);
  
  }
  </code></pre>
  
  <p>So what can be the solution? I used TabHost</p>