Currently there is no NPE ULF.It resolved now.now i am getting below exception only.But if i call only one fragment it doesn't give me any exception and it display the pdf file(WHether its fragment or fragment2).but if there is two fragment are there it gives me below exception
That stack trace looked identical to the one you posted before, so I have deleted it. Please don't post the same stuff more than once.
The reason I asked about the NPE is because you mentioned an NPE in the title of this topic. It is confusing if you then post the stack trace of some other exception, which apparently has nothing to do with your question. Please be more careful in the future.
I note that both fragments have different layouts, and that the exception seems to have to do with layouts. So post the layout XML of both fragment classes.
This also begs the question: why do you have two fragment classes, and why do they have different layouts?
i used two fragments as i need to pageviewer.i need to go other fragment whne user swipe.
I understand that you need multiple fragments, but my question was why you were using two fragment classes? The normal approach is to use the same class for all fragments. You want all fragments to be the same, just showing different PDFs, no? That would call for a single fragment class.
i tried without pdf file,then pageviwer works fine and gives me page by page. below is the code.
fragment1 layout file
fragment2 layout file
this is working fine,when i swipe it goes to next fragment.but when i add pdf fiel open to each fragment it gives me above error. is i am calling pdf open in wrong lifecycle methos or is there any other place call that method?