Search code examples
androidfragmenttapjoy

TapJoy offer list in Fragment


I am currently developing a Android application for a client who wants TapJoy integration, and wants to show only the offer list provided by TapJoy. The app has Actionbar sherlock integrated and has five tabs, and one of the tabs should display this offer list. So I downloaded the jar and the attached documentation and followed their examples on how to display the offer list.

While doing this I came to the conclusion that when you execute the following code.

Hashtable<String, String> flags = new Hashtable<String, String>();
flags.put(TapjoyConnectFlag.ENABLE_LOGGING, "true");

// Connect with the Tapjoy server.  Call this when the application first starts.
// REPLACE THE SECRET KEY WITH YOUR SECRET KEY.
TapjoyConnect.requestTapjoyConnect(getSherlockActivity().getApplicationContext(), "bba49f11-b87f-4c0f-9632-21aa810dd6f1", "yiQIURFEeKm0zbOggubu", flags);
TapjoyConnect.getTapjoyConnectInstance().showOffers();
TapjoyConnect connect = TapjoyConnect.getTapjoyConnectInstance();

note: the value of the keys are from the examples from tapjoy self

It launches an new Activity with a Webview, I know this for a fact because you had to declare the activity with the com identifier of the tapjoy class in my Android manifest.

If I use the code provided above, every time when the tab on the left/right and the actually offer list displaying tab gets loaded, it launches a new Activity and this is kinda a unusual workflow. And totally not Fragment pager like behaviour.

Now for my question ! Did somebody managed to get.

  1. the complete ruquested URL (So I can load it in my own webview)
  2. Let it return a Webview component so I can add it to my Fragment.
  3. Hit me with something else that will works.

I already tried to extend some of the classes, but the class the launches the activity is a singleton class and I get a an error on in the constructor on the super.

thanks in advance.


Solution

  • Nope this cant be doen, lets hope that tapjoy will consider the android UI guidline in the future and include fragments in the new libs