Does anyone know how I can pass an integer (the score from my game) to AppAcitivty.java in order to show this on a pop menu that allows user to share it ?
so far I have this but im not sure where to go from here ?
I was looking at some other code , is
final AppActivity activity = ((AppActivity)Cocos2dxHelper.getActivity()); does the same thing as
private static Activity activity = AppAcitivity.getInstance(); ?
also in this example I was following they called method.env->DeleteLocalRef(stringMessage); do I have to do something similar for the integer im passing in ?
Hello @dimon4eg could you help me with this ? inside the onConsentFormLoaded method it says for “variable ‘form’ is accessed from within inner class must be declared final” but then when I declare it final it then shows a error “variable ‘form’ might not have been initialized” I tried declaring 'private static ConsentForm form" at the top of my class but then it gives a error saying about placing android context classes inside a static field will result in a memory leak so im not sure where to go from here ?
public static void settings()
{
final AppActivity activity = ((AppActivity) Cocos2dxHelper.getActivity());
activity.runOnUiThread(new Runnable() { @Override
public void run() {
URL privacyUrl = null;
try {
// TODO: Replace with your app’s privacy policy URL.
privacyUrl = new URL(“https://privacy-policy”);
} catch (MalformedURLException e) {
e.printStackTrace();
}
ConsentForm form = new ConsentForm.Builder(getContext(), privacyUrl).withListener(new ConsentFormListener() {
@Override
public void onConsentFormLoaded() {
// Consent form loaded successfully.
Log.i(“consent”, “consent loaded”);
form.show();
}
@Override
public void onConsentFormOpened() {
// Consent form was displayed.
}
@Override
public void onConsentFormClosed(ConsentStatus consentStatus, Boolean userPrefersAdFree) {
Log.i(“consent”, "consent form was just closed the consent status is " + consentStatus);