Greetings,
In my logs I get an error telling me to initialise the view. I thought that loading a layout was enough to initialise the text view but it looks like I may need to use an initialise statement in the TextChanged sub routine because if I comment out the sub routine there is no crashing the app.
Code that loads the layout the text view is in:
Code used to hide the hint when text is entered into the text field:
The view is also defined from the designer as:
The logs showing the error:
The layout with the text view:
In my logs I get an error telling me to initialise the view. I thought that loading a layout was enough to initialise the text view but it looks like I may need to use an initialise statement in the TextChanged sub routine because if I comment out the sub routine there is no crashing the app.
Code that loads the layout the text view is in:
B4X:
Sub ButtonSongDetails_Click
' Make views slide down out of site.
'-----------------------------------
clvSongList.Clear
PanelSongList.SetLayoutAnimated(300, 0, Activity.Height, Activity.Width, _
Activity.Height)
ButtonBackToMenu.SetLayoutAnimated(300, 0, Activity.Height, Activity.Width, _
Activity.Height)
ButtonClearSong.SetLayoutAnimated(300, 0, Activity.Height, Activity.Width, _
Activity.Height)
ButtonSongDetails.SetLayoutAnimated(300, 0, Activity.Height, Activity.Width, _
Activity.Height)
Activity.LoadLayout("SongDetails")
End Sub
Code used to hide the hint when text is entered into the text field:
B4X:
Sub b4xfloattextfieldsongtitle_TextChanged (Old As String, New As String)
b4xfloattextfieldsongtitle.mBase.GetView(1).Visible = (New.Trim.Length = 0)
End Sub
The view is also defined from the designer as:
B4X:
Private B4XFloatTextFieldSongTitle As B4XFloatTextField
The logs showing the error:
B4X:
main_b4xfloattextfieldsongtitle_textchanged (java line: 431)
java.lang.RuntimeException: Object should first be initialized (View).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.B4XViewWrapper.GetView(B4XViewWrapper.java:317)
at b4a.natures.song.main._b4xfloattextfieldsongtitle_textchanged(main.java:431)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1082)
at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:1045)
at b4a.natures.song.b4xfloattextfield._tf_textchanged(b4xfloattextfield.java:755)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.objects.EditTextWrapper$1.afterTextChanged(EditTextWrapper.java:83)
at android.widget.TextView.sendAfterTextChanged(TextView.java:11652)
at android.widget.TextView.setText(TextView.java:6839)
at android.widget.TextView.setText(TextView.java:6630)
at android.widget.EditText.setText(EditText.java:140)
at android.widget.TextView.setText(TextView.java:6582)
at android.widget.TextView.setTransformationMethod(TextView.java:2870)
at android.widget.TextView.applySingleLine(TextView.java:11307)
at android.widget.TextView.setSingleLine(TextView.java:11281)
at anywheresoftware.b4a.objects.EditTextWrapper.setSingleLine(EditTextWrapper.java:140)
The layout with the text view:
Last edited: