Android Question When touch the EditText, the program jumped out (crash)

foretek

Member
Licensed User
I use an EditText in my APP. First a string is loaded to the EditText.Text, and when the EditText is touched on screen, it pop up a keyboard and works. In the APP, another string is then loaded to the EditText.Text, this time when the EditText is touched, the program is crash. I couldn't catch the cause of the problem. I got some message as below. Can anyone give me a hint what the problem might be? Thanks.

upload_2019-12-25_0-24-3.png
 

foretek

Member
Licensed User
Thank you for replies. In the manifest, I tried to add a line of 12 and it didn't fix it.
upload_2019-12-25_8-56-57.png
I collected the whole logs from beginning to run the APP until it crashes as attached.
 

Attachments

  • logData.txt
    69 KB · Views: 163
Upvote 0

foretek

Member
Licensed User
I ran and checked the logs for my previous version of the code before I added the EditText in. The log shows the same "FATAL EXCEPTION" messages in the beginning of the log. Even this code was running ok without crashing. It looks my code has potential defect inheres in it.
 
Upvote 0

foretek

Member
Licensed User
Hi, DonManFred, I am uploading my early version of the project, which doesn't have the EditText but it shows in Debug Mode the same "FATAL EXCEPTION" messages as in the later version of the code. I am thinking these FATAL EXCEPTION may be the root cause of the problem. Would you please check what goes wrong and how to fix it. Thank you for the help.
 

Attachments

  • eBB_Crash.zip
    45.2 KB · Views: 168
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
i replaced your incomplete manifest with this one
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
and ran your app in debug

i saw a layout with two buttons and a grid but no crash happens
 
Upvote 0

foretek

Member
Licensed User
Hi, DonManFred, thanks for quick reply. I'll try the manifest soon. Here is the project with EditText and it crashes.
 

Attachments

  • eBB_Crash2.zip
    45.4 KB · Views: 164
Upvote 0

klaus

Expert
Licensed User
Longtime User
Here is the project with EditText and it crashes.
Because you haven't changed the manifest !
Attached your project with the new manifest, which works like for DonManfred.
 

Attachments

  • eBB_Crash2New.zip
    9.5 KB · Views: 179
Upvote 0

foretek

Member
Licensed User
Hi, I replaced you new manifest scrips to the existing project, it does NOT crash. Great. But I found that the fix also disabled the AddMenuItem button. Can we bring back the button, which I use it for bluetooth?

Activity.AddMenuItem("Connect", "mnuConnect")
Activity.AddMenuItem("Disconnect", "mnuDisconnect")
 
Upvote 0

foretek

Member
Licensed User
AddMenuItem button is very nice space saving button with icon " ⋮ " at the right corner. Just wanted to make sure if the new version B4A has eliminated the button? If it is, new coding need to be made for the new B4A. I wish it kept that.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Just wanted to make sure if the new version B4A has eliminated the button?
I don't know.
Anyway, if this happens it is not due to B4A but to Android.
Google adds in every new version new features and also removes some features.
 
Upvote 0

foretek

Member
Licensed User
I would think it is more related to my APP. I use the same phone, same version of Android, it shows the button and works fine before the manifest change. Does it make sense?
 
Upvote 0

foretek

Member
Licensed User
The phone I am using has Android 8.1.0 on it. The key worked on the phone with the old manifest. The new manifest fixed the crash problem but caused the key loss. I just wanted to know, is it possible for me to use the key again with some new manifest not crashing? It is ok if there is no way to use the key again. I'll change my code.
 
Upvote 0

foretek

Member
Licensed User
Hi, Klaus, I found that if the code: "#IncludeTitle: False" is changed to be True, we can see the "Activity ⋮ ". Thank you for bringing it back. But unfortunately the " ⋮ " key will always take a whole new line space on top of the screen instead of shared with system buttons at bottom as it was in old manifest. Is there any way this line can be auto-hide? Otherwise it takes a little too much space for the APP.
 
Upvote 0
Top