listactivity - calling listactiviy from tabactivity in android -


Is it possible to call through tab activity? Actually, I'm developing an app with 3 tabs, for which I'm using tabactivity. In addition, in a tab I want a list view, so I have obtained from the listing.

Now I want the click event to be set in the list view. Am I missing something?

  public class Tabitauti Tabaktiviti extended {/ ** Called when the activity went previously created * / @ Override public Crete to zero (the bundle saved Instansstet) {super. Contents (Saved Instantstate); TabHost host = getTabHost (); Host.addTab (host.newTabSpec ( "Tab1"). Setindiketr ( "Tab 1"). SetContent (new intention (it, Tab1.class))); Host.addTab (host.newTabSpec ("Tab2"). Set indicator ("Tab2") SetContent (new intent (this, Tab2.class))); Host.setCurrentTab (1); }}  

tab 1 class

  increases public class tab 2 list expansion {ListView list; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); SetContentView (R.layout.tab2); Array list & lieutenant; Hashmap & lt; String, string & gt; & Gt; Mylist = new Arrivals & Lt; Hashmap & lt; String, string & gt; & Gt; (); Hashmap & lt; String, string & gt; Map = new hashmap & lt; String, string & gt; (); Map.put ("Test1", "####"); Map.put ("Test 2", "India"); Map.put ("Time", "India Time"); Mylist.add (map); Map = new hashmap & lt; String, string & gt; (); Map.put ("Test1", "####"); Map.put ("Test 2", "US"); Map.put ("time", "US time"); Mylist.add (map); Map = new hashmap & lt; String, string & gt; (); Map.put ("Test1", "####"); Map.put ("Test2", "UK"); Map.put ("time", "UK time"); Mylist.add (map); ListAdapter mSchedule = new SimpleAdapter (This, Mylist, Rklayoutkrow, new String [] { "India", "US", "UK"}, new Int [] (Arkdktikarkai.an .an.al.an.al., Arkaidkfom_ CELL, Arkaidi. TO_CELL,}); list.setAdapter (mSchedule);}  

}

< / div>

set your list active ITemClickListener:

  getListView (). SetOnItemClickListener (new OnItemClickListener ( ) {@Override public void onItemClick (adapter sequence & lt ;? & Gt; av, view v, int position, long id) {//} your stuff here});  

Comments