Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8756855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:10:05+00:00 2026-06-13T14:10:05+00:00

I have a Sherlock Tab Navigation implemented as the following two classes. Class Dashboard

  • 0

I have a Sherlock Tab Navigation implemented as the following two classes. Class Dashboard is the main activity. Class DashboardContacts represents one of the tab’s fragment.

I am loading HTTP data that gets loaded in a while and when it loads I need the list view in DashboardContacts to reflect the changes brought in from Server and refresh the ListView from blank to filled list. For this i’m calling notifyDataSetChanged method through refresh method in DashboardContacts, but no change relects in ListView until I change the tabs.

public class Dashboard extends SherlockFragmentActivity {

    private DashboardContacts contactsTab=new DashboardContacts();
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dashboard);

        getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        ActionBar.Tab tab = getSupportActionBar().newTab();
        tab.setText(getResources().getStringArray(R.array.dashboardTabs)[0]);
        tab.setTabListener(new DashboardHome());
        getSupportActionBar().addTab(tab);

        ActionBar.Tab tab2 = getSupportActionBar().newTab();
        tab2.setText(getResources().getStringArray(R.array.dashboardTabs)[1]);
        tab2.setTabListener(contactsTab);
        getSupportActionBar().addTab(tab2);

        //CALLS ASYNCLOADER HERE TO LOAD HTTP DATA
    }

    private void httpSuccessMethod() {
        //Does some work and then calls:
        contactsTab.refresh(datasource.getAllContacts());

    }

Here is the DashboardContacts class layout:

public class DashboardContacts extends SherlockListFragment  implements ActionBar.TabListener{

    private UserListAdapter listAdapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
        listAdapter=new UserListAdapter(container.getContext(), ApplicationState.getInstance(container.getContext()).getUserCache());
        setListAdapter(listAdapter);
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public void onStart() {
        super.onStart(); 
    }


    @Override
    public void onTabSelected(Tab tab,android.support.v4.app.FragmentTransaction ft) {
        ft.replace(android.R.id.content, this,"contacts");
        ft.attach(this);
    }

    @Override
    public void onTabUnselected(Tab tab,android.support.v4.app.FragmentTransaction ft) {
        ft.detach(this);

    }

    @Override
    public void onTabReselected(Tab tab,android.support.v4.app.FragmentTransaction ft) {
        // TODO Auto-generated method stub

    }


        public void refresh(List<User> list) {
        if(this.listAdapter != null) {
        this.listAdapter.setList(list);
        this.listAdapter.notifyDataSetChanged();
    }
}

The refresh method in the custom list adapter looks like, so I am actually changing the data there too:

public void refresh(List<User> list) {
    if(this.listAdapter != null) {
        this.listAdapter.setList(list);
        this.listAdapter.notifyDataSetChanged();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:10:07+00:00Added an answer on June 13, 2026 at 2:10 pm

    I think this is something I didn’t implement, so I did it now and solved the issue:

    public void setList(List<ExpensePool> list) {
        clear();
        addAll(list);
        notifyDataSetChanged();
    }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've implemented Sherlock action bar tabs today, so my tab handling class extends SherlockActivity
I am trying to use Tab Navigation in Actionbar Sherlock, and in which tab
I have two tabs on an ActionBar (Sherlock). In some cases I want to
I have successfully implemented actionsherlock in my project.so here is my code: public class
I have a one activity and one layout application. I am implementing ActionBarSherlock, but
I have application which uses Sherlock ActionBar package. The application uses platform-specific behavior for
have written this little class, which generates a UUID every time an object of
Have deployed numerous report parts which reference the same view however one of them
I have my interface implemented with ActionBarSherlock, and it works great with the newest
Have such user_session model: class UserSession < Authlogic::Session::Base logout_on_timeout true # default if false

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.