Android Question Listview position

Almora

Well-Known Member
Licensed User
Longtime User
Dim a1 As String


İf xxx.a1=0 then
Listview.Add........
Listview.Add........
Listview.Add........

Else if xxx.a1=1 then
Listview.Add........

End if


İf Position =0 then
Start act..... İt's. Work..

İf Position =1 then
Start act..... İt's. Work..

İf Position =2 then
Start act..... İt's. Work..


İf Position =3 then
Start act..... İt's NO WORK..

HELP... English bad...
 

DonManfred

Expert
Licensed User
Longtime User
Trainstation? Raining in Africa?

I dont understand your question!!
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
No working...
I STILL dont understand your question!

UPLOAD YOUR PROJECT so we can see it in action and we can better understand the problem.
In the IDE under File->Export as zip. Upload this zip

I for myself are loosing the mood to help with this INCOMPLETE info...
 
Upvote 0

Almora

Well-Known Member
Licensed User
Longtime User
Button1 click----->> ok.
Button2 clik----->>page2---->>4444----->>page3---->>tttttttttt (it no work kkkkkkkkk)
 

Attachments

  • sample11.zip
    13.9 KB · Views: 161
Upvote 0

moster67

Expert
Licensed User
Longtime User
you're not loading page4.bal. You're not using Acitivity.LoadLayout in "Page4"-module.

Tip: Check always the top of the log-pane. You would see B4a giving you a warning about this error so you could remedy.
 
Upvote 0

Almora

Well-Known Member
Licensed User
Longtime User
no. it is not a problem.I know that.

Button2 clik----->>page2---->>4444----->>page3---->>tttttttttt (it no work kkkkkkkkk)

kkkkkkkk=????
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
I don't understand what you mean...

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.

Sorry but I cannot understand your problem/logic
 
Upvote 0

Almora

Well-Known Member
Licensed User
Longtime User
i guess the problem is in his wrong IF structures... See page3 code

B4X:
    If page1.a1=0 Then page2.a2=0 Then
            ListView1.AddSingleLine("tttttttt")
            ListView1.AddSingleLine("yyyyyyyyyyy")
    Else [...]


Button2 clik----->>page2---->>4444----->>page3---->>kkkkkkk (Ok)

Button1 clik----->>page2---->>1111----->>page3---->>ttttttt, yyyyyy. (Ok)

Button1 clik----->>page2---->>2222----->>page3---->>jjjjjjjjj,rrrrrrrrr,dddddd,gggggg. (No working)
 

Attachments

  • sample12.zip
    13.9 KB · Views: 156
Upvote 0

Almora

Well-Known Member
Licensed User
Longtime User
I don't understand what you mean...

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.

Sorry but I cannot understand your problem/logic


Page 4 added.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
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 !?
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
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.
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
İf Position =3 then Start act..... İt's NO WORK..
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 )
 
Last edited:
Upvote 0

mangojack

Expert
Licensed User
Longtime User
was doing nothing ... this might help you do whatever your trying to do :confused:
 

Attachments

  • Sample2 Test.zip
    13.9 KB · Views: 170
Upvote 0

Almora

Well-Known Member
Licensed User
Longtime User
Hello..
I do not want to get clicks on page 4.

Example....
I click on page3 B1B1B1 not appear on page 4.
 

Attachments

  • sample13.zip
    15 KB · Views: 160
Last edited:
Upvote 0
Top