Android Question i have some small problem

ibra939

Active Member
Licensed User
Longtime User
example i creat new program also this program have more Layout
example
*main
Layout 1
Layout 2
Layout 3
Layout 4

the main i create ImageView1 and text if i want ImageView1 when some body click go to Layout 1 and hide the *main ???? what the code for this

i use this code but not working :


End Sub
Sub ImageView1_Click
Activity.LoadLayout("Layout 1.bal")
End Sub

what the code is different for ImageView1 , button , text ?
 

ibra939

Active Member
Licensed User
Longtime User
14 view with no replay ?
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
Thanks but even simple word ......if some replay you feel there is replay in my thread

i will check and test
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Just to add to the reply count...... I am struggling to follow what you are asking. Therefore cannot give a reliable answer.
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
Just to add to the reply count...... I am struggling to follow what you are asking. Therefore cannot give a reliable answer.


this simple design as i press designer then i create 3 Layout also one is the MainLayout

MainLayout
Layout 1
Layout 2
Layout 3


I am using this code in ImageView1 at MainLayout


End Sub
Sub ImageView1_Click
Activity.LoadLayout("Layout 1.bal")
End Sub

what problem this code is wrong i can't move when i click i can't go to Layout1 ???? so it show the pic( ImageView1) ???
also if there differnt code for all type doing same thing i need it
what the code is different for ImageView1 , button , text ?
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
You have 3 options

* As Erel stated, us separate activities for the different layouts

* Create Panels in the main code and load each layout to a panel. Then set the desired panel visibility as required.

* When you do ImageView1_Click. Do
B4X:
Activity.RemoveAllViews
Activity.LoadLayout(xxxxx)

To be honest, the options are in preferred order. So try to do it as option 1, try to avoid option 3...
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
the same problem

Sub ImageView1_Click

Activity.RemoveAllViews
Activity.LoadLayout("Layout 1.bal")

End Sub

Not working
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
I want to add a page with text and photo and the bar can move to down and up to read other text and photo
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
I had a look at your code, but don't understand what exactly you want to do.
You need to be much more precise in your explanations on what you want to do.

In the main activity you have an event routine Button1_Click but you have no layout with the button nor added it in the code.
Therefore Button1_Click has no effect !
In your first post you speak about Sub ImageView1_Click but in the project you posted you use Button1_Click !?
Then you have 10 activity modules with nothing in, what are these for !?

Please explain in detail what you want to do so we could give you concrete advices.
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
jest what i want Layout name second i create 11 ImageView i want each picture when you click move to Layout help or another Layout what i created
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
Sorry, but you still don't explain in detail what you want to do and what you expect.
Posting the same question in different threads, like here, will not give you a quicker answer, I'm afraid that people will get bored.
As long as you don't explain in DETAIL what you EXACTLY you want, nobody could help you (sorry, but I still don't understand).
The project you posted shows that you have not taken the time trying to learn the basics of B4A !
The purpose of this forum is to help each others if we have concrete propblems, not to write the application for you.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
This is not something I normally suggest, but it may be beneficial if you post in your language and someone may be able to translate better.
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
Jest i want control this layout using text , picture with out using button ( when i click at picture moving to another layout .....so simple i explain ) ?
 

Attachments

  • 123.png
    123.png
    64.8 KB · Views: 244
Upvote 0

jsanchezc

Member
Licensed User
Longtime User
Is a good practice not use space in file names:
Instead this:
MainLayout
Layout 1
Layout 2
Layout 3

Use this:
MainLayout
Layout_1
Layout_2
Layout_3


End Sub
Sub ImageView1_Click
Activity.LoadLayout("Layout_1.bal")
End Sub

Also, as post Erel: better use one activity for each layout.
Each activity has its own code and events.
And you can control better your running App.
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
This is not something I normally suggest, but it may be beneficial if you post in your language and someone may be able to translate better.

thanks for replay
 
Last edited:
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
Sorry, but you still don't explain in detail what you want to do and what you expect.
Posting the same question in different threads, like here, will not give you a quicker answer, I'm afraid that people will get bored.
As long as you don't explain in DETAIL what you EXACTLY you want, nobody could help you (sorry, but I still don't understand).
The project you posted shows that you have not taken the time trying to learn the basics of B4A !
The purpose of this forum is to help each others if we have concrete propblems, not to write the application for you.

i explain so many but not problem . trying to get the answer thanks for replay
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
Is a good practice not use space in file names:
Instead this:
MainLayout
Layout 1
Layout 2
Layout 3

Use this:
MainLayout
Layout_1
Layout_2
Layout_3


End Sub
Sub ImageView1_Click
Activity.LoadLayout("Layout_1.bal")
End Sub

Also, as post Erel: better use one activity for each layout.
Each activity has its own code and events.
And you can control better your running App.

really i try to use but i get same problem when i use ImageView1_Click ? why?
 
Upvote 0
Top