How to initialise all activities under activitygroups when using tabhost
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4912827/android-activitygroup-nullpointerexception">Android ActivityGroup - NullPointerException</a>  </p>
</blockquote>



<p>I have 4 x tabs, each with an activityGroup with several activites.
On a certain button click, I want to call SupplierItem activity and switch to the tab like so:</p>

<pre><code>Intent myIntent;
myIntent = new Intent(v.getContext(), SupplierItem.class);
myIntent.putExtra("SCRef",ProductInst.getSupplierid());
myIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
view = SupplierGroup.group.getLocalActivityManager()  
                         .startActivity("SupplierItem", myIntent)  
                         .getDecorView();
SupplierGroup.group.replaceView(view);  
SourcingCity.switchToTab(2); 
</code></pre>

<p>This works fine provided Tab 2 has previously been accessed by the user. 
But I get a NullPointerException if the tab has not been previously accessed.
So my question is how to initialise the Activity (SupplierItem in this case, in SupplierGroup) ?</p>
