Hi all ... I am currently combining B4A / B4J project  and hit a small bump.
Both projects have Activity / Modules ... Main, Income, Expenses, Calendar & Summary. (95% code transferred to shared classes)
The Main activity/module displays 4 panels / labels acting as buttons to move between the Activity / Modules.
I have been able to reduce code in B4A ...
previously ..
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
revamped ..
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
But .. is there anyway to do something similar with B4J ?
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
And if I may .. a second question .
Is it safe / acceptable to use compilation tags with Event Sub signatures ie:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Many Thanks
			
			Both projects have Activity / Modules ... Main, Income, Expenses, Calendar & Summary. (95% code transferred to shared classes)
The Main activity/module displays 4 panels / labels acting as buttons to move between the Activity / Modules.
I have been able to reduce code in B4A ...
previously ..
			
				B4X:
			
		
		
		Sub pnlButton_Click   
    Dim pnl As Panel = Sender 
  
    Select pnl.Tag
        Case "Income"
            StartActivity(Income)
        Case "Expenses"
            StartActivity(Expenses)
'.............................revamped ..
			
				B4X:
			
		
		
		Dim pnl As B4XView = Sender 
StartActivity(pnl.Tag)But .. is there anyway to do something similar with B4J ?
			
				B4X:
			
		
		
		Sub pnlButton_MouseClicked (EventData As MouseEvent)   
    Dim pnl As B4XView = Sender 
  
    Select pnl.Tag   
        Case "Income"
            Income.StartModule        'StartModule is a Public Sub to initialize form / class etc ...  (if uninitialized)
        Case "Expenses"
            Expenses.StartModuleAnd if I may .. a second question .
Is it safe / acceptable to use compilation tags with Event Sub signatures ie:
			
				B4X:
			
		
		
		#if B4A
    Sub pnlButton_Click   
#Else
    Sub pnlButton_MouseClicked (EventData As MouseEvent)
#End If
    'code ..........
End SubMany Thanks
 
				 
 
		 
 
		 
 
		 
 
		