Java Question Need Help with ba.activity

itgirl

Active Member
Licensed User
Hello guys im trying to make a very simple wrapper for RevMob but i can't seem to get it right ba.activity always return NULL !! even with the "@ActivityObject".
so any advice guys ?


B4X:
package revmob.test.wrapper;
import com.revmob.RevMob;
import android.app.Activity;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.ShortName;


@ActivityObject
@ShortName("RevmobTest")
public class revmob extends Activity {
    private BA ba;
    private String eventName;
    private RevMob revmob;
    
    public void InitializeRevMob(BA ba, String EventName )
    {
    this.ba = ba;
    revmob.start(ba.activity);
    revmob.showFullscreen(ba.activity);

    }
}
 

itgirl

Active Member
Licensed User
Hey Erel thanks for answering, infact i have regenerated the XML and i have tried to compile using eclipse and SLC , no luck at all just keeps giving NULL. and yeah i know about the JavaObject but this is not a simple wrappers i intend to make more complicated adding all the companies not just RevMob. but no luck
 

itgirl

Active Member
Licensed User
i have tried the same code but with AppBrain it works like a charm but why revmob return NULL ??!! NOTE that i have already added the Dependson values on both

B4X:
package appbrain.test.wrapper;
import com.appbrain.AppBrain;
import android.app.Activity;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.ShortName;


@ActivityObject
@ShortName("AppBrainTest")
@DependsOn(values={"google-play-services","revmob","appbrain"})
public class AppBrainextends Activity {
    private BA ba;
    private String eventName;

    public void AppBrainT(BA ba, String EventName )
    {

      AppBrain.init(ba.activity);
      AppBrain.getAds().showInterstitial(ba.activity);

    }
}
One more question if i wanted to pass the ba.activity as object so in b4a call it something like (ME) how can i do that ? to make sure it will never be NULL
 
Top