Android - Scoreloop Andengine social media share

256 views Asked by At

i'm implementing Scoreloop in my Andengine game but I'm having some issues with score sharing via social media.

I followed this Tutorial to implement the Scoreloop system in my app. Everything is working, except the sharing of score to social media.

I use one activity in my game, the rest consists of scenes. The scoreloop documentation for ScoreloopUI gives the following code to call the "share score" screen:

startActivityForResult(new Intent(this,PostScoreOverlayActivity.class), POST_SCORE);     

And this code to receive the user response:

public void OnActivityResult(int requestCode, int resultCode, Intent data){
 super.onActivityResult(requestCode, resultCode, data);
 switch (requestCode) {
         case SHOW_RESULT:
                //......Some custom changes if needed to be done
                 break;
         case POST_SCORE:
                //......Some custom changes if needed to be done
                 break;}}    

I want to call the "share screen" from a non activity scene, so I passed my activity to this scene and used the following code:

activity.startActivityForResult(new Intent(activity,PostScoreOverlayActivity.class), score);    

My problem is that I don't know where to put these lines of code. I tried everything but I just can't get it working.

Thank you in advance

Edit: I understand that I have to override OnActivityResult in an activity class. I tried to create a new activity class and override the OnActivityResult but I still could not get it working.

Is anyone able to give me some advice on how to do this?

0

There are 0 answers