Android refresh fragment listview at onrestart of fragmentactivity - android

From my FragmentActivity, i want to update my ListView of a Fragment(created by code) at onRestart of the FragmentActivity. There is no fragment and tag in XML file. Here is my FragmentActivity.
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
viewPager = (ViewPager) findViewById(R.id.pager);
mAdapter = new ProfilePagerAdapter(getSupportFragmentManager(),
myFriendsList, notifiedFriendsList);
viewPager.setAdapter(mAdapter);
..........
my FragmentPagerAdapter is
public class ProfilePagerAdapter extends FragmentPagerAdapter {
private ArrayList<Friend> myFriends;
private ArrayList<ExpandableChild> notifiedFriendsList;
private SparseArray<Fragment> registeredFragments = new SparseArray<Fragment>();
public ProfilePagerAdapter(FragmentManager fm, ArrayList<Friend> myFriends, ArrayList<ExpandableChild> notifiedFriendsList) {
super(fm);
// TODO Auto-generated constructor stub
this.myFriends = myFriends;
this.notifiedFriendsList = notifiedFriendsList;
}
#Override
public Fragment getItem(int index) {
switch (index) {
case 0:
return new FriendsFragment(myFriends);
case 1:
return new MyProfileFragment(notifiedFriendsList);
}
return null;
}
#Override
public int getCount() {
return 2;
}
#Override
public Object instantiateItem(ViewGroup container, int position) {
Fragment fragment = (Fragment) super.instantiateItem(container, position);
registeredFragments.put(position, fragment);
return fragment;
}
#Override
public void destroyItem(ViewGroup container, int position, Object object) {
registeredFragments.remove(position);
super.destroyItem(container, position, object);
}
public Fragment getRegisteredFragment(int position) {
return registeredFragments.get(position);
}
In my FriendsFragment class, i have a ListView. I used following two methods to update the ListView from my FragmentActivity in the class.
public void setNewFriendList(ArrayList<Friend> myFriends){
this.friendsList = myFriends;
}
public void updateList(){
adapter.notifyDataSetChanged();
}
Now i want to update the ListView of FriendsFragment at onRestart() of FragmentActivity in following way.
#Override
protected void onRestart() {
// TODO Auto-generated method stub
super.onRestart();
android.support.v4.app.Fragment frag = mAdapter
.getRegisteredFragment(0);
if (frag != null) {
((FriendsFragment) frag).setNewFriendList(myFriendsList);
((FriendsFragment) frag).updateList();
Toast.makeText(UserProfileTab.this, "Updated",Toast.LENGTH_LONG).show();
} else {
Toast.makeText(UserProfileTab.this, "Not Updated:",Toast.LENGTH_LONG).show();
}
}
But in Toast shows Not Updated as frag returns null. I followed link1 and link1. Thanks in advance.

Related

Get fragment activity outside of Fragment.OnCreateView()

I have a Fragment with a TableLayout. The data in the table is from a SQLite db. The SQLite db is populated from a RESTful webservice in an AsyncTask in the MainActivity. The Fragment must wait for the task to complete before populating the table. The Fragment listens for the task onPostExecute() method to be called. When it is, the method onLoadAndStoreComplete in the Fragment is called. This all works.
What doesn't work is that I need the fragment activity in order to create new TableRows and TextViews in onLoadAndStoreComplete and I can't get it.
I've tried:
- making a class member fragmentActivity and assigning in onCreateView(), but by the time it gets to onLoadAndStoreComplete(), it is null.
- calling this.getActivity() again in onLoadAndStoreComplete(), but it returns null.
How do I get the fragment activity?
MyFragment.java:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
fragmentActivity = this.getActivity(); // return value is valid
...
}
#Override
public void onLoadAndStoreComplete() {
fragmentActivity = this.getActivity(); // returns null
...
}
from MainActivity.java (extends ActionBarActivity)
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mainActivity = this;
setContentView(R.layout.activity_main);
Resources resources = getResources();
String[] tabTitleArray = { resources.getString(R.string.first_fragment),
resources.getString(R.string.second_fragment),
resources.getString(R.string.help_fragment) };
viewPager = (ViewPager) findViewById(R.id.pager);
actionBar = getSupportActionBar();
mAdapter = new TabsPagerAdapter(this.getSupportFragmentManager());
viewPager.setAdapter(mAdapter);
actionBar.setHomeButtonEnabled(false);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
for (String tab_name : tabTitleArray) {
actionBar.addTab(actionBar.newTab().setText(tab_name).setTabListener(this));
}
// On swiping the ViewPager, select the respective tab
viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
#Override
public void onPageSelected(int position) {
actionBar.setSelectedNavigationItem(position) ;// on changing the page, make respected tab selected
}
#Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
#Override
public void onPageScrollStateChanged(int arg0) {
}
});
String url = "http://myrestfulwebservice";
Fragment secondFragment = mAdapter.getItem(SECOND_TAB);
new LoadAndStoreDataTask((OnLoadAndStoreCompleteListener)secondFragment).execute(url);
}
} // end OnCreate
TabsPagerAdapter.java
public class TabsPagerAdapter extends FragmentPagerAdapter {
public TabsPagerAdapter(FragmentManager fragmentManager) {
super(fragmentManager);
}
#Override
public Fragment getItem(int index) {
switch (index) {
case 0:
return new FirstFragment();
case 1:
return new SecondFragment();
case 2:
return new HelpFragment();
}
return null;
}
#Override
public int getCount() {
return 3; // get item count - equal to number of tabs
}
public static void setTabColor(TabHost tabhost) {
for(int i=0;i<tabhost.getTabWidget().getChildCount();i++) {
tabhost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#FF0000")); //unselected
}
tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab()).setBackgroundColor(Color.parseColor("#0000FF")); // selected
}
}
I haven't tested this, but it seems to me that it would work.
Add a Context parameter to the constructor for both TabsPagerAdapter and MyFragment.
Something like this:
TabsPagerAdapter.java:
public class TabsPagerAdapter extends FragmentPagerAdapter {
private Context mCtx;
public TabsPagerAdapter(FragmentManager fragmentManager, Context context) {
super(fragmentManager);
mCtx = context;
}
#Override
public Fragment getItem(int index) {
switch (index) {
case 0:
return new FirstFragment(mCtx);
case 1:
return new SecondFragment(mCtx);
case 2:
return new HelpFragment(mCtx);
}
return null;
}
#Override
public int getCount() {
return 3; // get item count - equal to number of tabs
}
public static void setTabColor(TabHost tabhost) {
for(int i=0;i<tabhost.getTabWidget().getChildCount();i++) {
tabhost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#FF0000")); //unselected
}
tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab()).setBackgroundColor(Color.parseColor("#0000FF")); // selected
}
}
MainActivity.java:
mAdapter = new TabsPagerAdapter(this.getSupportFragmentManager(), this);
MyFragment.java (do this in FirstFragment, SecondFragment, and HelpFragment):
public static class MyFragment extends Fragment {
private Context fragmentActivity ;
public MyFragment(Context context){
fragmentActivity = context;
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//.........
return rootView;
}
#Override
public void onLoadAndStoreComplete() {
//do something with fragmentActivity
}
}
It seems the AsyncTask starts too early. suggest loading the db in onActivityCreated(), it's be called after onCreateView
#Override
public void onActivityCreated (Bundle savedInstanceState) {
//load your db here
}

Android Viewpager.setCurrentitem() and FragmentPagerAdapter instantiateItem() fragments initailize mismatch

I have problem with FragmentPagerAdapter ,I have set fragments in viewpager through FragmentPagerAdapter,
I have to show viewpager dynamically,I have listview data , which I need to show in viewpager,
when I click on the listview , I have to load exact position in the viewpager
so i just set the total size of the item to show in FragmentPagerAdapter, But the problem is that when I select the viewpager position through mPager.setCurrentItem(listposition) it show correct position of the viewpager,
but the data load at wrong place, it load in next fragement in viewpager position,after some tracking in FragmentPagerAdapter, I show that instantiateItem method initailize one fragment in advance, like i set the currentitem (from listview)of viewpager 2
then instantiateItem method initalize 0 to 3 fragment, I think that the reason the data load in 3rd fragment,I tried a lot with FragmentStatePagerAdapter also but no any success , please help me , thanks in advance.
Mainactivity class(Fragmnetactivity) :
public class NewsDetail extends FragmentActivity implements OnClickListener {
public static ViewPager mPager;
private static int NUM_PAGES;
private PagerAdapter mPagerAdapter;
public static ArrayList<Integer> exist_detail = new ArrayList<Integer>();
public static ArrayList<PageFragment> detailfragment = new ArrayList<PageFragment>();
mPager = (ViewPager) findViewById(R.id.pager);
mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
mPager.setAdapter(mPagerAdapter);
NUM_PAGES = topList.size();
PageFragment fragment = new PageFragment();
Bundle args = new Bundle();
args.putInt("page", i);
fragment.setArguments(args);
detailfragment.add(fragment);
mPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
#Override
public void onPageSelected(int arg0) {
if (PageFragment.getInstance() != null) {
Log.d("LOG","PageFragment || "+ PageFragment.getInstance());
PageFragment.getInstance().startLoadingNews(
MusicList.topMusicList.get(arg0)._id);
}
return;
}
#Override
public void onPageScrolled(int arg0, float arg1, int arg2) {}
#Override
public void onPageScrollStateChanged(int arg0) {}
});
mPagerAdapter.notifyDataSetChanged();
mPager.setCurrentItem(listposition);// setcurrent item from here , it is selected from list. "listposition" indicate list position click
private class ScreenSlidePagerAdapter extends FragmentPagerAdapter {
private FragmentManager mFragmentManager;
private FragmentTransaction mCurTransaction = null;
private Fragment mCurrentPrimaryItem = null;
private static final boolean DEBUG = false;
public ScreenSlidePagerAdapter(FragmentManager fragmentManager) {
super(fragmentManager);
this.mFragmentManager = fragmentManager;
}
#Override
public Fragment getItem(int position) {
return detailfragment.get(position);
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return super.getItemId(position);
}
#Override
public Object instantiateItem(ViewGroup container, int position) {
Log.v("LOG", "On InstantiateItem " + position);// it indicate that this method initialize one fragment in advance.
return super.instantiateItem(container, position);
}
public String makeFragmentName(int viewId, long index) {
return "android:switcher:" + viewId + ":" + index;
}
#Override
public void destroyItem(ViewGroup container, int position, Object object) {
if (mCurTransaction == null) {
mCurTransaction = mFragmentManager.beginTransaction();
}
if (DEBUG)
Log.e("LOG", "Detaching item #" + position + ": f=" + object
+ " v=" + ((Fragment) object).getView());
mCurTransaction.detach((Fragment) object);
}
#Override
public void restoreState(Parcelable state, ClassLoader loader) {
}
#Override
public int getCount() {
return NUM_PAGES;
}
}
}
PageFragment
public class PageFragment extends Fragment implements OnClickListener {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPageNumber = getArguments().getInt(ARG_PAGE);
mDetailPageFragment = this;
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout containing a title and body text.
rootView = (ViewGroup) inflater.inflate(R.layout.newsdetail, container,
false);
//init();
return rootView;
}
public void startLoadingNews(String _id) {
if (NetworkUtil.cheackNetwork(mActivity)) {
executeTask(_id);
} else {
showRetryCancelDialog();
}
}
}
I can see two issues in the code you've posted:
Only instantiate your fragments in FragmentPagerAdapter.getItem. Don't instantiate them and save them to some list or array, let the FragmentPagerAdapter do that for you. In FragmentPagerAdapter.instantiateItem it checks if the Fragment was already created and if so it returns it, if not, it'll call your getItem to create the fragment.
Don't use the Singleton scheme for your fragment, create a new fragment using a constructor or a .newInstance() static helper.

Options menu is getting cleared in view pager android?

I am using options menu in action bar tabs,view pager and nested fragments, when i switch from fragmentA to fragmentB using tabs menu items are working fine, but when i try to swith using view pager option items are getting invisble in fragments.
public class RTHomeTabFragment extends Fragment implements TabListener,OnBackButtonPressInterfaceForFragment{
public ActionBarActivity parentActivity;
private ActionBar actionBar;
ViewPager mViewPager;
public static int currentPage;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
RTMessagingUtils.log(getClass().getName(), "onCreateView");
View view = inflater.inflate(R.layout.viewpager_tabs, container,false);
parentActivity = (ActionBarActivity) getActivity();
actionBar = parentActivity.getSupportActionBar();
mViewPager = (ViewPager) view.findViewById(R.id.pager);
/* actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);*/
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setCustomView(null);
actionBar.removeAllTabs();
List<Fragment> fragments = getFragments();
pagerAdapter adapter = new pagerAdapter(getChildFragmentManager(), getFragments());
mViewPager.setAdapter(adapter);
currentPage=mViewPager.getCurrentItem();
Log.d("TestFragments", "currentPage======"+currentPage);
mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
#Override
public void onPageSelected(int position) {
actionBar.setSelectedNavigationItem(position);
currentPage=mViewPager.getCurrentItem();
Log.d("TestFragments", "currentPage======"+currentPage);
}
});
for (int i = 0; i < adapter.getCount(); i++) {
actionBar.addTab(actionBar.newTab().setText(adapter.getPageTitle(i)).setTabListener(this));
}
return view;
}
private List<Fragment> getFragments(){
List<Fragment> fList = new ArrayList<Fragment>();
// add fragments here
fList.add(new Test1());
fList.add(new Test2());
fList.add(new Test3());
return fList;
}
class pagerAdapter extends FragmentPagerAdapter{
private List<Fragment> fragments;
public pagerAdapter(FragmentManager fm, List<Fragment> fragments){
super(fm);
this.fragments = fragments;
}
#Override
public Fragment getItem(int position) {
return this.fragments.get(position);
}
#Override
public int getCount() {
return this.fragments.size();
}
#Override
public CharSequence getPageTitle(int position) {
Locale l = Locale.getDefault();
switch (position) {
case 0:
return getString(R.string.db_jio_chat_chats).toUpperCase(l);
case 1:
return getString(R.string.db_jio_chat_groups).toUpperCase(l);
case 2:
return getString(R.string.db_jio_chat_contacts).toUpperCase(l);
/*case 3:
return getString(R.string.db_jio_chat_my_profile).toUpperCase(l);
case 4:
return getString(R.string.db_jio_chat_location).toUpperCase(l);
case 5:
return getString(R.string.db_jio_chat_about).toUpperCase(l);*/
}
return null;
}
}
#Override
public void onTabReselected(Tab arg0, FragmentTransaction arg1) {
// TODO Auto-generated method stub
}
#Override
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
// setHasOptionsMenu(true);
super.onCreate(savedInstanceState);
}
#Override
public void onTabSelected(Tab arg0, FragmentTransaction arg1) {
// TODO Auto-generated method stub
mViewPager.setCurrentItem(arg0.getPosition());
}
#Override
public void onTabUnselected(Tab arg0, FragmentTransaction arg1) {
// TODO Auto-generated method stub
}
#Override
public void onResume() {
super.onResume();
RTMessagingUtils.log(getClass().getName(), "onResume");
}
#Override
public void onPause() {
super.onPause();
RTMessagingUtils.log(getClass().getName(), "onPause");
}
}
In your getItem method do this for testing :
#Override
public Fragment getItem(int position) {
if(position == 0)
return new Test1();
else
return new Test2();
}
and see if this works, I will find an explanation later if it works...

How to refresh a fragment in a viewpager?

I know there are already some questions to this problem. But I am really new in Android and ecspecially to Fragments and Viewpager. Pls have passion with me. I didn't found a answer which fits to my code.
I dont know how to refresh a fragment or reload it when it's "active" again.
TabsPagerAdapter.java:
public class TabsPagerAdapter extends FragmentPagerAdapter{
public TabsPagerAdapter(FragmentManager fm){
super(fm);
}
#Override
public Fragment getItem(int index) {
switch (index) {
case 0:
return new KFZFragment();
case 1:
return new LogFragment();
case 2:
return new TrackFragment();
}
return null;
}
#Override
public int getCount() {
// get item count - equal to number of tabs
return 3;
}
}
I have this 3 Fragments (KFZFragment,LogFragment,TrackFragment) and on the TrackFragment I calculate some data and this data should be display in a ListView in LogFragment.
But when I change to LogFragment it's not the latest data. So it doesnt refresh.
Now how should I modify my code to refresh the fragments when it's "active"?
MainActivityFragment.java:
public class MainActivityFragment extends FragmentActivity implements ActionBar.TabListener{
private ViewPager viewPager;
private TabsPagerAdapter mAdapter;
private ActionBar actionBar;
List<Fragment> fragments;
private String[] tabs = { "KFZ", "Fahrten Log", "Kosten Track" };
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_fragment);
// Initilization
viewPager = (ViewPager) findViewById(R.id.pager);
actionBar = getActionBar();
mAdapter = new TabsPagerAdapter(getSupportFragmentManager());
fragments = new Vector<Fragment>();
fragments.add(Fragment.instantiate(this, KFZFragment.class.getName(),savedInstanceState));
fragments.add(Fragment.instantiate(this, LogFragment.class.getName(),savedInstanceState));
viewPager.setAdapter(mAdapter);
actionBar.setHomeButtonEnabled(false);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
// Adding Tabs
for (String tab_name : tabs) {
actionBar.addTab(actionBar.newTab().setText(tab_name)
.setTabListener(this));
}
viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
#Override
public void onPageSelected(int position) {
// on changing the page
// make respected tab selected
actionBar.setSelectedNavigationItem(position);
}
#Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
#Override
public void onPageScrollStateChanged(int arg0) {
}
});
}
#Override
public void onTabReselected(Tab tab, FragmentTransaction ft) {
// TODO Auto-generated method stub
}
#Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
viewPager.setCurrentItem(tab.getPosition());
}
#Override
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
// TODO Auto-generated method stub
}
#Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
}
return super.onKeyDown(keyCode, event);
}
}
Pls help me out.
In each of your KFZFragment, LogFragment, and TrackFragment, you should be able to override onResume in your fragment class and put your necessary refresh/reload code there.
Why not? use static methods to refresh the data
I agree with Jonathan Lin
But if the fragment you want to update is the fragment that is currently shown you can do something similar to this:
public class DisplayPagerAdapter extends FragmentPagerAdapter {
private static final String TAG = "DisplayPagerAdapter";
SparseArray<DisplayFragment> registeredFragments = new SparseArray<DisplayFragment>();
public DisplayPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public int getCount() {
DisplayCoreModule display = DisplayCoreModule.getInstance();
return (display != null && display.getPagesCount() > 0) ? display.getPagesCount() : 1;
}
#Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
#Override
public Fragment getItem(int position) {
Log.d(TAG, "getItem " + position);
return DisplayFragment.newInstance(position);
}
#Override
public CharSequence getPageTitle(int position) {
DisplayCoreModule display = DisplayCoreModule.getInstance();
if (display != null && display.getPagesCount() > 0) {
return "Side " + (position+1);
} else {
return super.getPageTitle(position);
}
}
#Override
public Object instantiateItem(ViewGroup container, int position) {
Log.d(TAG, "instantiateItem " + position);
DisplayFragment fragment = (DisplayFragment) super.instantiateItem(container, position);
registeredFragments.put(position, fragment);
return fragment;
}
#Override
public void destroyItem(ViewGroup container, int position, Object object) {
Log.d(TAG, "destroyItem " + position);
registeredFragments.remove(position);
super.destroyItem(container, position, object);
}
public Fragment getRegisteredFragment(int position) {
return registeredFragments.get(position);
}
public SparseArray<DisplayFragment> getRegisteredFragments() {
return registeredFragments;
}
}
It is the registeredFragments part that I wanted to show you.
Since you use FragmentPagerAdapter then getRegisteredFragment(int position) will always return one of your fragments given that you provide a valid position. Should you change to FragmentStatePagerAdapter at some point, it can return null on some of the positions.
Now, in TrackFragment create a callback to your MainActivity, which then informs LogFragment, shown here in pseudo code:
Fragment TrackFragment {
interface TrackFragmentCallback() {
public void newInfo()
}
TrackFragmentCallback trackFragmentCallback;
onAttatch() {
// make sure to implement TrackFragmentCallback on MainActivity
trackFragmentCallback = (TrackFragmentCallback)getActivity();
}
// When this fragment has new info, simply do:
trackFragmentCallback.newInfo();
}
MainActivity implements TrackFragmentCallback {
newInfo() {
// get LogFragment
LogFragment logFragment = pagerAdapter.getRegisteredFragment(1);
if (logFragment != null) {
logFragment.update();
}
}
}
Hope this helps.

Android viewPager - fragment

I have a an activity in which i am setting a viewPager adapter as shown below
public class ViewPagerAdapter extends FragmentPagerAdapter {
private int pagerLength;
private HashMap<Integer, String> mFragmentTags;
private FragmentManager mFragmentManager;
String page = "Page";
public ViewPagerAdapter(FragmentManager fm, int numPage) {
super(fm);
mFragmentManager = fm;
pagerLength = numPage;
mFragmentTags = new HashMap<Integer, String>();
}
#Override
public Object instantiateItem(ViewGroup container, int position) {
Object obj = super.instantiateItem(container, position);
if(obj instanceof Fragment) {
Fragment f = (Fragment) obj;
String tag = f.getTag();
mFragmentTags.put(position, tag);
}
return obj;
}
#Override
public Fragment getItem(int index) {
ImageFragment imageFragment = (ImageFragment)Fragment.instantiate(ImageActivity.this, imageFragment.class.getName(), null);
return imageFragment;
}
#Override
public int getCount() {
return pagerLength;
}
public Fragment getFragment(int position) {
String tag = mFragmentTags.get(position);
if (tag == null) {
return (Fragment)instantiateItem(mViewPager, position);
}
Fragment fragment = mFragmentManager.findFragmentByTag(tag);
return fragment;
}
#Override
public void destroyItem(ViewGroup container, int position, Object object) {
mFragmentTags.remove(position);
super.destroyItem(container, position, object);
}
#Override
public CharSequence getPageTitle(int position) {
// TODO Auto-generated method stub
return "TESTING"; //Remove later
}
}
ImageFragment is nothing spl its just a fragment with an imageView in its layout
Now I want to set a image in the imageView of the fragment from activity how am I supposed to do that?
I tried making a fn update in my activity and passing the imageUrl to a function called update in fragment. The problem is that although the update() in fragment gets called and receives the url of image, the onCreateView() of the fragment is never invoked

Categories

Resources