ReRunDesignerScript bug

Penko

Active Member
Licensed User
Longtime User
Hello there!

I am actually not sure if this one is a bug or not but the fact is I can't get it to work. Attached is the layout file.

What I am doing is to resize the Activity if AdMob receives an ad. It works perfectly for my other activities but not for this one.

This panel with the three buttons was inside another layout file but was included in a scrollView that's why I moved them(delete from the other layout, create them here). By running the LayoutScript, everything looks fine.

The problem comes when the ad is received. I don't think it's necessary to post any code, just this:

B4X:
Sub Activity_Create(FirstTime As Boolean)
      Activity.LoadLayout(main_layout)  
End Sub

Sub AdMob_ReceiveAd
   Admober.ReceiveAd(Activity, adMob, main_layout)
End Sub

' Admober code module
Sub ReceiveAd(Activity As Activity, adMob As AdView, layout As String)

       Common.LogT("AdMob received", "EVENT")
   
      Activity.RerunDesignerScript(layout, 100%x, 100%y - adMob.Height)
End Sub

The exact error I get is: "java.lang.RuntimeException: java.lang.RuntimeException: Cannot find view: pnlbuttons2. All views in script should be declared".

Once more, this code is reused with all activities that show ads and it's working everywhere.

I've tried cleaning my project but it didn't help either.

Any ideas?
 

Attachments

  • laytesting_newdef.bal
    4.9 KB · Views: 167
Top