• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to call a library project from fragment

 
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I will suppress my every urge. But not this shameless plug:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic