Text disappear

twocpv

Member
Licensed User
Longtime User
Need help,
I’ve got my app running but on my android mobile after typing in the edit text field and when I change the position of the phone from portrait to landscape the words just disappear. It becomes blank.
Thanks in advance.
 

twocpv

Member
Licensed User
Longtime User
Please be more specific (e.g.: page number or what example), I am not sure where to look at.
Thanks
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
Ch. 9 (Intro, and Activity_Pause sections), and 15.1.5

Though I recommend reading the whole thing
 
Upvote 0

twocpv

Member
Licensed User
Longtime User
Thanks for your responses.
I couldn't compile the "StateManger" because I need library for "Reflector". Pls provide the link for library. Thanks

I now know and understand the chapter 9 and 15 but I so new to this software and I need codes example. Please provide if you have one. Thanks
 
Upvote 0

warwound

Expert
Licensed User
Longtime User

The only library that you need to include with StateManager is the RandomAccessFile library.

It's one of the libraries included with B4A so there is no need to download it.

Martin.
 
Upvote 0

twocpv

Member
Licensed User
Longtime User
Such a newbie.....I still got the this message:
An error occurred.
Error parsing program.
Error description: Unknown type: reflector
Are you missing a library reference:
Occurred on line: 10
Dim Obj1 As Reflector


I follow the link for library but can't see the library for this. And I don't know how to import or add the library.
Please give me more detail and more instruction.

Also I am trying to stop to text disappearing.

Thanks for you help
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
The Reflection library is part of B4A - there is no need to download it.

Look at the attached screengrab.
Select the Libs tab in the IDE and you should see Refelction listed there.

Martin.
 

Attachments

  • reflection.jpg
    16.6 KB · Views: 258
Upvote 0

Andras

Active Member
Licensed User
Longtime User
Another even simpler approach might be to make sure that the app only runs in Portrait mode - you can choose this option under Orientations Supported in the Project Menu.

But you do need to be able to understand the life cycle of an app - an app runs in a far more restricting environment than a program on a PC or Mac, and the rules do need to be followed.

John
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I couldn't compile the "StateManger" because I need library for "Reflector".
I don't know what code snippets you have put together because StateManger doensn't need the Reflector library so this problem is somewhere else in your program. To help us giving you the best advice you must post your project as a zip file then we can look at it, see what you have done, test it in the same conditions as you do and give you a concrete advice. Otherwise we must continue the 'riddle game'.

The original problem of loosing the text in the EditText view is due to the life cycle of the activity. When you change the orientation the cureent Activity is paused and recreated. If you want to save the content of views you must save them in Activity_Pause and restore them in Activity_Resume. There are different solutions to save the data:
- StateManger
- global variables
- in a file

The second problem with the missing Reflector library is a new problem you added with some code, but has nothing to do with the StateManger module.
Without your code we cannot help more.

Best regards.
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Upvote 0

twocpv

Member
Licensed User
Longtime User
Thanks all I got the example of StateManager works now.
Will try to understand this.
If there are any futher instruction or guide regarding orientation would be greatly appreciate.

Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…