views:

11

answers:

0

I've gotten this to work with separate Activities, but don't want the overhead or the difficulty sharing information between tabs. So I've split it into Views as opposed to activities. Problem is, it won't update the list when I create it as the examples I've found online show it.

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.qwarqcentral);

try { qLib = new Lib(); qLib.setUpdateListener(this); } catch (SomeSneakyException qe) { Log.e(TAG, "Exception while setting up qLib - ", qe); }

//SET UP USERTAB userList = (ListView) this.findViewById(R.id.usertab);
userList = new ListView(this); try { users = new ArrayList(Arrays.asList(qLib.getUserListWithoutAvatar()));
} catch (SomeSneakyException qe) { Log.e(TAG, "Exception while getting userlist - ", qe); }
userAdapter = new UserAdapter(this, R.layout.user_row, users); userList.setAdapter(userAdapter);
this.setContentView(userList);

tabHost = getTabHost();
userTab.setContent(R.id.usertab); tabHost.addTab(tabHost.newTabSpec("userTab").setIndicator("User Tab").setContent(R.id.usertab));

tabHost.setCurrentTab(0);

userAdapter.notifyDataSetChanged(); }

As is, it will display an empty list view as opposed to the populated list view that I have created. If I set this.setContentView(userList); it will instead set up the list of users. Obviously I'm doing something wrong, but what? I have checked several examples and have followed them as closely as I can and read through the documentation, but can't find what I'm looking for....

Help? :D