Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call onResume() of Fragment

Tags:

android

I used Navigation drawer , with number of fragments. I want to call onResume() of fragment , Where i need to load updated data from server.

like image 512
Priya Sasane Avatar asked Jul 29 '15 09:07

Priya Sasane


1 Answers

onResume() will be called when your Activity onResume() is called, you don't have to call onResume() in a Fragment.

Read this to understand the Fragment Lifecycle

If you want to do it from your Fragment you should do something like this

@Override
    public void onResume(){
        super.onResume();
        //OnResume Fragment
    }

Also if you have to do something general you can do it on your Activity it's the same as the Fragment

like image 122
Skizo-ozᴉʞS Avatar answered Oct 19 '22 23:10

Skizo-ozᴉʞS