Well, the Sub should have a parameter declared as Object, of course:
Public Sub MyDialog(Data As Object)
Then you should use GetType to detect the type of the object:
Dim DataType As String = GetType(Data)
Select DataType
Case ...
Case ...
End Select
Write logs to read what DataType will contain (strings).
Then in each Case create an object of the type detected; for example, if it were a Map, you would create:
Dim mapData As Map = Data
This can help you, in case of Arrays:
https://www.b4x.com/android/forum/threads/checks-on-arrays.39374/#content