How can I tell which viewpager this is when I try to take a print with a floating boot?

Asked

Viewed 50 times

0

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

I have the code below, which takes the photo but superimposes 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);
}

1 answer

0


//retorna indice da pagina que está sendo exibida
int indicePaginaAtual = mViewPager.getCurrentItem();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.