I have 3 tabs in MainActivity
, which loads the content in ViewPager
. But when the activity starts it loads the contents of second tab also which is off-screen. My tabs are like received message and sent message, and when there are no messages in any, I am showing a Toast that "There are no messages". SO now when the activity starts the default tab "Received" has the messages but still a Toast is shown because there are no "Sent" messages in the second tab.
I want the content of second tab to be loaded only when user selects it.