How to differentiate in which viewpager this is when I try to get a print with a floating button?

0

I have a view with several fragments, I added a floating button to get print from the screen, but I would like to know how to differentiate each fragment to put different names in the photos.

I have the code below, which takes the photo but overlaps the next ones because it has the same name.

@OnClick(R.id.fab_client_screenshot)
public void printScreen() {
    String fileName = "foto.png";
    JUtil.saveScreenShot(mViewPager.getRootView(), fileName);
}
    
asked by anonymous 25.08.2015 / 16:38

1 answer

0
//retorna indice da pagina que está sendo exibida
int indicePaginaAtual = mViewPager.getCurrentItem();
    
27.08.2015 / 05:48