Android Question java.lang.RuntimeException: Object should first be initialized (EditText)

Isac

Active Member
Licensed User
Longtime User
I get this error : Error occurred on line: 28 (storico)
java.lang.RuntimeException: Object should first be initialized (EditText)



B4X:
#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region
 
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
 
End Sub
 
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
 
  
    Dim linea As String
    Dim lettura As TextReader
    Private EditText1 As EditText
  
End Sub
 
Sub Activity_Create(FirstTime As Boolean)
    lettura.Initialize(File.OpenInput(File.DirRootExternal,"Prova.txt"))
    linea=lettura.ReadAll
    Log(linea)
    EditText1.Text=linea
    lettura.Close
  
  
 
 
 
End Sub
 
 
Sub Activity_Resume
 
End Sub
 
Sub Activity_Pause (UserClosed As Boolean)
 
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
if the layout is designed in designer than you forgot to load that layout.
If not from designer then you have to initialize the objects by yourself
B4X:
Sub Activity_Create(FirstTime As Boolean)
  lettura.Initialize(File.OpenInput(File.DirRootExternal,"Prova.txt"))
  linea=lettura.ReadAll
  Log(linea)
  EditText1.Initialize("edittext")
  EditText1.Text=linea
 
Upvote 0

steele2012

Member
Licensed User
Longtime User
java.lang.RuntimeException: Object should first be initialized (WebView).

All off my apps that i built on with the last version all have this Error

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