[LibGDX][solved] Sharing Score.

The completed code is listed here.

1: Created an interface in the core project

package com.fmeg.tapout;

public interface ShareInterface {

	public void shareScore(int score);
	
}

2: Created a class in the android project

package com.fmeg.tapout.android;

import android.content.Intent;

import com.fmeg.tapout.ShareInterface;

public class AndroidShare implements ShareInterface {

	private AndroidLauncher application;
	
	public AndroidShare(AndroidLauncher application) {
		this.application = application;
	}
	@Override
	public void shareScore(int score) {
		Intent sendIntent = new Intent();
		sendIntent.setAction(Intent.ACTION_SEND);
		sendIntent.putExtra(Intent.EXTRA_TEXT, "Score: " + score);
		sendIntent.setType("text/plain");
		application.startActivity(sendIntent);
	}

}

in my main class for androidlauncher i have

AndroidShare shareScore = new AndroidShare(this);

and that’s as far as I can get, I don’t know how to actually call shareScore

3: in the main class(core project) add ShareInterface as a paremeter to your constructor.

use the share interface to send the score.

I was over-thinking this…
I was looking for some super-class to extend, not the Interface itself to toss in the core-applications parameters.

Got it all resolved.

You’ve posted several topics, some self-answered, on the same project here (36% of the last 22 posts, in fact), which leads me to question your effort. Asking questions is fine, and we all want to solve our bugs as fast as possible, but you need to think about your own questions some more before posting them.

I understand, I was just actually getting onto myself about this earlier, but I’m glad you brought it to my attention.