To refresh the current Android Fragment you can use the snippet below. The code must be placed inside the Fragment that needs to be updated. The snippet will call the onCreateView Method of the Fragment.
Samples
Sample Java
getFragmentManager().beginTransaction().detach(this).attach(this).commit();
If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.
Related links:
- Refresh or force redraw the fragment
- getFragmentManager() [developer.android.com]
- beginTransaction() [developer.android.com]
- detach() [developer.android.com]
- attach() [developer.android.com]
- commit() [developer.android.com]
RT @CodeSnippetsNET: Refreshing the current #Android Fragment -> https://t.co/xV46WLiWeC <- #java #developer #develop #mobiledeveloper #mob…
RT @CodeSnippetsNET: Refreshing the current #Android Fragment -> https://t.co/xV46WLiWeC <- #java #developer #develop #mobiledeveloper #mob…
RT @CodeSnippetsNET: Refreshing the current #Android Fragment -> https://t.co/xV46WLiWeC <- #java #developer #develop #mobiledeveloper #mob…
RT @CodeSnippetsNET: Refreshing the current #Android Fragment -> https://t.co/xV46WLiWeC <- #java #developer #develop #mobiledeveloper #mob…