Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to call a library project from fragment

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a library project which open a pdf file.I created another project with pageviewer contain 3 fragments. i need to call this library on each fragment.I added the library main class to my manifest file,but how to call Activity mothod inside fragment?

below is the Main class of Library project.I used PlugPdf library to view pdf file.




below is my project with fragments





fragment class



fragment2 class




fragment3 class



I need to call library project main activity on these fragments?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This looks like the same question you have asked before. You need to tell us what "i need to call this library" means. If it means to start an activity defined in that library, then you already know how to do that. If it means using a View in that library then you need to use that in your code, as I have pointed out multiple times. In either case, or if it means something else, you need to be much more detailed about what it is, what you have done so far, and where you are stuck making progress (as I have have also pointed out multiple times, but for some reason you insist in being mum on details - which does not help us help you).
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually i have created app which open a pdf file.I make it as a library.Now i have a app with pageviewer.I need to call that pdf library from my new app.I need to see pdf withing my fragments.So calling my library mainactivity is not the correct way i think? what is the correct way to get a output from library and show it in my new app?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this is now the 5th time that I say this, and I will not say it again: you need to find out whether that library has a View for this that you can use in your fragment. I told you how you might go about that here. For reasons I don't understand you seem not to have done that.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
currently i created the library project as a android project and the pdf opening part contain the MainActivity of that project.Is it good implementation or is it better to create it as a java class?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seeing that this is a commercial library, I would expect the developer docs and SDK to talk about how to use it. Since it seems that you're not at all close to getting it to work in the way you intend, it seems premature to worry about whether your approach is good design - you will probably have to change it anyway.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ULF. I copied the pdf opening part to each fragments.Now below are the new classes.

main class



fragment class



Manifest file





above is the exception i am getting.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic