How to refresh a fragment in a viewpageadapter through another activity
<p>I have a situation for my android app.The scenario is I am using a viewpage adapter whering I have 3 pages which are actually are fragments.My issues is that I want to update these from a dialog activity .The dialog activity containg a list from whose onclick event I want to update the fragment.</p>

<p>First of all is it possible if yes please do chip in and help me out.</p>

<p>Cheers
Gaurav</p>

<p>This is my view page adapter </p>

<pre><code>/*
 * Copyright (C) 2012 Gaurav Rawat
 * 
 */
package com.punksrant.ifinddryday.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.punksrant.ifinddryday.fragment.AllFragment;
import com.punksrant.ifinddryday.fragment.HomeFragment;
import com.punksrant.ifinddryday.fragment.SynchFragment;
import com.punksrant.ifinddryday.utils.IFindDryDaysConstants;
import com.viewpagerindicator.TitleProvider;

public class ViewPagerAdapter extends FragmentPagerAdapter implements
        TitleProvider {

    private static String[] titles = IFindDryDaysConstants.titles;

    public ViewPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public String getTitle(int position) {
        return titles[position % titles.length].toUpperCase();
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment;
        switch (position) {
        case 0:
            fragment = HomeFragment.newInstance();
            break;
        case 1:
            fragment = AllFragment.newInstance();
            break;

        case 2:
            fragment = SynchFragment.newInstance(titles[position
                    % titles.length]);
            break;

        default:
            fragment = HomeFragment.newInstance();
        }
        return fragment;
    }

}
' and in this I want to refresh the home fragment from my dialog class 
'/*
 * Copyright (C) 2012 Gaurav Rawat
 * 
 */
package com.punksrant.ifinddryday.activity;

import roboguice.inject.ContentView;
import roboguice.inject.InjectView;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.github.rtyley.android.sherlock.roboguice.activity.RoboSherlockFragmentActivity;
import com.google.inject.Inject;
import com.punksrant.ifinddryday.model.Coordinates;
import com.punksrant.ifinddryday.utils.DryDayJSONResParser;
import com.punksrant.ifinddryday.utils.IFindDryDayViewUtils;

@ContentView(R.layout.statedialog)
public class Dialog extends RoboSherlockFragmentActivity {
    @InjectView(R.id.dialogList)
    ListView listView;
    @Inject
    SharedPreferences preferences;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String[] states = DryDayJSONResParser.getSupportedStates();
        listView.setAdapter(new ArrayAdapter&lt;String&gt;(this,
                android.R.layout.simple_list_item_1, android.R.id.text1, states));
        listView.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                    int position, long id) {
                String state = ((TextView) view).getText().toString();
                Coordinates coordinates = IFindDryDayViewUtils
                        .getCoordinatesFromPreferences(preferences);
                coordinates.setState(state);
                IFindDryDayViewUtils.updateCityFromLocation(coordinates,
                        preferences);

                finish();
            }

        });
    }
},
</code></pre>
