Quantcast
Viewing all articles
Browse latest Browse all 3773

Android MobileScreen instance

Hi to all
Could you please help me to understand if this is a bug or a feature?

I have a MobileScreen (Screen2) with a string property (test as string)
In Screen2 I have a method (Constructor(value as string)) that takes value and set it to test
In the Activated event of Screen2 I have code to show the test property

Label3.Text = test

Screen1, the default mobile screen, has a button that (should) create a new instance of Screen2

Var value As String
value = TextField1.Text
Var a As New Screen2(value)
a.Show

Screen2 has the same button

What it happens?

  1. You run the app and see Screen1 → ok
  2. You write a value (value 1) and push Button1, Screen2 appears and you can see the value (value 1) you set → ok
  3. You write a new value (value 2) in Screen2 and push Button1 (in Screen2) and a (new?) Screen2 with the new value (value 2) appears ->ok
  4. Repeat point 3 as much you like, it works → ok
  5. Click on Back Button, actual Screen2(n) disappears and previous Screen2(n-1) appears; surprise, test value is not as it was, but is the last set → not ok
  6. Repeat point 5 as much as Screen2 you set before, every Screen2 has the same test value → not ok

It seems to me that the test property is shared between every single instance of Screen2
Am I wrong?
Thanks

MobileScreen instance.xojo_xml_project.zip (3.9 KB)

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3773

Trending Articles