your class can talk to the main element using the "callsub" methods. for example, in your class you could have something like:
Sub Class_Globals
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
CallSubDelayed2(Main, "loadMe", "https://www.b4x.com")
End Sub
this simple example runs the loadMe method in the activity. in this case, it passes the url that it wants webview to load.
===================================================================================
in the main element, you would have something like:
Sub Globals
'These global variables will be redeclared each time the activity is created.
Dim webview As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
webview.Initialize("")
Activity.AddView(webview,0%x,0%y,100%x,100%y)
Dim jac As JustAClass
jac.Initialize
End Sub
Sub loadMe(Url As String)
webview.LoadUrl( Url )
End Sub
in main you would have a method corresponding to the one called in your class. class causes main to load a particular url. class would call the method at the appropriate moment; for the example i do it on initialization of the class (which doesn't need to have an initialization if you don't have anything particular to carry out in such a method). in your case, you would call callsub2() when an sms was received.
since you mention sms, i should mention that you would have to convince google to allow you to handle sms's if you were thinking of publishing the app on play.