Note that there are some explanatory texts on larger screens.

plurals
  1. POPassing Data between Activities of TabHost Control
    primarykey
    data
    text
    <p>I have a tabhost which add tab's dynamically. My problem is updating the data in one tab with another tab values selected.</p> <p>For Ex: I have two tabs named 'Search &amp; Filter' and intents added in TabHost activity page. When i select some values from spinners like 'site &amp; equipment' from filter tab i want to update the search tab list view with specified selection from filter tab. </p> <p>I have attached my sample code. Kindly verify it and suggest me on the same.</p> <p>TabHost Activity:</p> <pre><code>public class TabSearch : TabActivity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Search_WOTab); TabHost.TabSpec tspec; Intent intent; intent = new Intent(this, typeof(WOSearch)); intent.AddFlags(ActivityFlags.NewTask); tspec = TabHost.NewTabSpec("Search"); tspec.SetIndicator("Search", Resources.GetDrawable(Resource.Drawable.Search)); tspec.SetContent(intent); TabHost.AddTab(tspec); intent = new Intent(this, typeof(WOFilter)); intent.AddFlags(ActivityFlags.NewTask); tspec = TabHost.NewTabSpec("Filter"); tspec.SetIndicator("Filter", Resources.GetDrawable(Resource.Drawable.Filter)); tspec.SetContent(intent); TabHost.AddTab(tspec); TabHost.TabChanged += (sender, e) =&gt; { Spinner workorder = FindViewById&lt;Spinner&gt;(Resource.Id.sp_site); object Data; //Here always showing null to spinner control if (workorder!=null) Data = workorder.SelectedItem; Toast.MakeText(this, TabHost.CurrentTab.ToString(), ToastLength.Short).Show(); }; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload