Android Question Help Plz (getting errors)

klaus

Expert
Licensed User
Longtime User
The goal of the forum is to post the answers in the forum so other users may also take some benefit.

Comments:
The problem you have is that when you click on rbt1,
the routine Sub rb1_CheckedChange is called and there you have
the line bhome.Enabled=True
but the bhome layout is not loaded so the button bhome is not yet known by the system.
How do you want to handle bhome layout ?

You can remove the Sub RemoveView routine and replace every RemoveView call by Activity.RemoveAllViews.

Your layouts q1, q2, q3 etc look almost the same but have some minor differences in the positions and size of the views, is this really what you need ?
Instead of having a different layout for each question you could use one layout and update the views in the code.
 
Upvote 0

mohammed1989

New Member
Licensed User
Longtime User
The goal of the forum is to post the answers in the forum so other users may also take some benefit.

Comments:
The problem you have is that when you click on rbt1,
the routine Sub rb1_CheckedChange is called and there you have
the line bhome.Enabled=True
but the bhome layout is not loaded so the button bhome is not yet known by the system.
How do you want to handle bhome layout ?

You can remove the Sub RemoveView routine and replace every RemoveView call by Activity.RemoveAllViews.

Your layouts q1, q2, q3 etc look almost the same but have some minor differences in the positions and size of the views, is this really what you need ?
Instead of having a different layout for each question you could use one layout and update the views in the code.


sorry. i dont understand the comments u said... if its is possible can you make the changes and send it to me so i can see what changes u have made.. i would really appreciate ur help.. my email is: [email protected]
 
Upvote 0

mohammed1989

New Member
Licensed User
Longtime User
Like I said, the ones you've created with the designer.

in the app when i select the radiobutton it gives me error

an error has occurred in sub: java.lang.runtimeException: object should first be initialized (button)

y am i getting this error when it is a radio button
 
Upvote 0
Top