Android Question Callsub question

rossati

Active Member
Licensed User
Longtime User
Hi

I have, in an activty module, this call:
CallSub3("Charts","draw" & chartType,Canvas,dd)
A call works except when the software orientation has changed, why?

Giovanni Rossati
 

rossati

Active Member
Licensed User
Longtime User
Merci Klaus

Le code est lourd; J'ai transformé l'unique CALLSUb en une ensemble de SELECT CASE ; cependant j'aimerais savoir pourquoi la CALL a été ignoré après que l'activité a changé d'orientation.
(En tout cas la call est dans le meme activity module)

Jean Rossati
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User

Jean, though Klaus is speaking french, this is the english forum. However he asked you to show the code (or a small example that reproduces the problem)
 
Upvote 0

rossati

Active Member
Licensed User
Longtime User
Thanks, I apologize
In a little example this works, my be is my error.
John Rossati
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Again, without seeing the code how do you expect us to help you?
And, as you say, that in a small project it works !?
Set breakpoints at different positions in your code and go step by step through the code to look what happens.
Even, if you posted your entire project, that's what I would need to do to understand what happens.
But, if you don't succed, ask back.
Another question, as your routine is in the same activity, why do you call it with CallSub3(...) and not directly ?
Be aware that when the orientation is changed the activity is killed and rebuilt again.
But, as we don't know what you have done and how, all this is just speculations.
It is very difficult and frustrating to help in this kind of situation.
 
Upvote 0

rossati

Active Member
Licensed User
Longtime User
Thanks Klaus and keep calme.
why do you call it with CallSub3(...) and not directly ?
I solved my problem, instead one instruction I have this:
B4X:
        Select chartType
            Case "Area"
                drawArea(Canvas,dd)
            Case "Bar"
                drawBar(Canvas,dd)
            Case "Bubble"
                drawBubble(Canvas,dd)
            Case "Delta"
                drawDelta(Canvas,dd)
            Case "Line"
                drawLine(Canvas,dd)
            Case "Pie","Ring"
                drawPie(Canvas,dd)
            Case "Point"
                drawPoint(Canvas,dd)
            Case "Scatter"
                drawScatter(Canvas,dd)
            Case "Venn"
                drawVenn(Canvas,dd)
        End Select
'        CallSub3(Me,"draw" & chartType,Canvas,dd)
Set breakpoints at different positions in your code and go step by step through the code to look what happens.
this I did, simply the function is not called.
Be aware that when the orientation is changed the activity is killed and rebuilt again.
Yes I manage this, the code before the call is well executed.
It is very difficult and frustrating to help in this kind of situation
I simply wanted to report this fact, and anyway I apologize for making you waste time.
If, however, you are interested I can send you the entire project (a business chart generator) being completed.
John Rossati
 
Upvote 0

rossati

Active Member
Licensed User
Longtime User
I apologize there is only one Rossati, the name is Giovanni, Jean in french and John in English.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I apologize there is only one Rossati, the name is Giovanni, Jean in french and John in English.
My name stays the same, being it in Portuguese, in Greek or even in Chinese! (Sorry for the off-topic)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…