所有标签都包含列表视图,但最后一个标签的值显示在所有标签中, 我也在第一个标签上祝酒并返回正确的值, 我认为数据库不正确但我错了它运作良好 为我糟糕的英语而烦恼
th.setup();
TabSpec specs = th.newTabSpec("gamestag");
specs.setContent(R.id.gamesTab);
specs.setIndicator("games");
th.addTab(specs);
specs = th.newTabSpec("kidstag");
specs.setContent(R.id.kidsTab);
specs.setIndicator("kids");
th.addTab(specs);
specs = th.newTabSpec("shoestag");
specs.setContent(R.id.shoesTab);
specs.setIndicator("shoes");
th.addTab(specs);
specs = th.newTabSpec("othertag");
specs.setContent(R.id.otherTab);
specs.setIndicator("others");
th.addTab(specs);
specs = th.newTabSpec("healthtag");
specs.setContent(R.id.healthTab);
specs.setIndicator("health");
th.addTab(specs);
specs = th.newTabSpec("carstag");
specs.setContent(R.id.carsTab);
specs.setIndicator("cars");
th.addTab(specs);
intitializelists();
intitializelists()
Eldealerdb db = new Eldealerdb(AllOffers.this);
db.open();
games_item = db.getCategoriesItem("games", Acity);
kids_item = db.getCategoriesItem("kids", Acity);
shoes_item = db.getCategoriesItem("shoes", Acity);
others_item = db.getCategoriesItem("others", Acity);
health_item = db.getCategoriesItem("health", Acity);
cars_item = db.getCategoriesItem("cars", Acity);
db.close();
//games list
// create new adapter
ItemListBaseAdapter adapter = new ItemListBaseAdapter(this, games_item);
// set adapter to list view
mListgames.setAdapter(adapter);
// implement event when an item on list view is selected
mListgames.setOnItemClickListener(this);
//kids list
// create new adapter
ItemListBaseAdapter adapter1 = new ItemListBaseAdapter(this, kids_item);
// set adapter to list view
mListkids.setAdapter(adapter1);
// implement event when an item on list view is selected
mListkids.setOnItemClickListener(this);
//shoes list
// create new adapter
ItemListBaseAdapter adapter2 = new ItemListBaseAdapter(this, shoes_item);
// set adapter to list view
mListshoes.setAdapter(adapter2);
// implement event when an item on list view is selected
mListshoes.setOnItemClickListener(this);
//others list
// create new adapter
ItemListBaseAdapter adapter3 = new ItemListBaseAdapter(this,
others_item);
// set adapter to list view
mListothers.setAdapter(adapter3);
// implement event when an item on list view is selected
mListothers.setOnItemClickListener(this);
// create new adapter
//health list
ItemListBaseAdapter adapter4 = new ItemListBaseAdapter(this,
health_item);
// set adapter to list view
mListhealth.setAdapter(adapter4);
// implement event when an item on list view is selected
mListhealth.setOnItemClickListener(this);
//cars list
// create new adapter
ItemListBaseAdapter adapter5 = new ItemListBaseAdapter(this, cars_item);
// set adapter to list view
mListcars.setAdapter(adapter5);
// implement event when an item on list view is selected
mListcars.setOnItemClickListener(this);