Where do you expect to see "kkkkkkkk"? In Page4 in a new activity?
In this sub:
B4X:
If Position = 0 Then
a3="0"
StartActivity(page4)
Activity.Finish
End If
In this sub you opening activity (page4). Where are you assigning the label in Page4 to "kkkkkkkk"? Also you are not opening layout page4.bal as mentioned in my previous e-mail.
Where do you expect to see "kkkkkkkk"? In Page4 in a new activity?
In this sub:
B4X:
If Position = 0 Then
a3="0"
StartActivity(page4)
Activity.Finish
End If
In this sub you opening activity (page4). Where are you assigning the label in Page4 to "kkkkkkkk"? Also you are not opening layout page4.bal as mentioned in my previous e-mail.
Please explain in detail what ecactly you want to do.
Because you never explained in detail your logic nor what exactly is not working!
There were an error in your code about no layout not loaded.
Then you explain this is not the problem and you say again 'it does not work' !?
So what and where is the problem.
How do you expect us to help you if you don't:
- Firts ! Explain what exactly you want to acheive. Sorry but I have not yet understood it,
- Explain in detail what is not working!
For me, your project, seems to be a kind of test program with no real logic behind it.
To be able to give a concrete advice you must provide a clear and detailed explanation on what exactly you want to do.
Try once to invert the roles:
With your explanations, how would you exlpain what do to !?
I must agree with Klaus. It is difficult to understand what you want and the logic.
If you are having problems explaining yourself in English, then use Google Translate. Most of the times, it works quite well.
Position will Never = 3 The most lines you load at any 1 time is 3 ... ( Position 0 - 2 )
Replace code Page3 > Activity_Create with this ...
B4X:
Log ($"a1 = ${page1.a1} a2 = ${page2.a2}"$)
Select page1.a1
Case 0
If page2.a2=0 Then
ListView1.AddSingleLine("tttttttt")
ListView1.AddSingleLine("yyyyyyyy")
else if page2.a2=1 Then
ListView1.AddSingleLine("jjjjjjjj")
ListView1.AddSingleLine("rrrrrrrr")
ListView1.AddSingleLine("dddddddd")
ListView1.AddSingleLine("gggggggg")
End If
Case 1
If page2.a2=0 Then '@@@@ If page1.a1 = 1 > page2.a2 will only ever be 0 or 1
ListView1.AddSingleLine("kkkkkkkk") 'Not 2 or 3 !!!
ListView1.AddSingleLine("zzzzzzz")
Else if page2.a2=1 Then
ListView1.AddSingleLine("llllllll")
End If
End Select
While this may solve the above problem , it creates another ..
Like others .. I do not understand what you are trying to do .. nor the logic behind this test.
Example - you have 2 buttons on page1. Button1 will add 3 lines to a ListView 'OR' Button2 will add 2 lines to ListView. The Listview only has 3 items (maximum) .
Then in Page2 , you run code on ListView_Click positions (0 - 4)!
Button2 clik----->>page2---->>4444----->>page3---->>kkkkkkk ( NOT working now )