Android Question another date picker. attempt to invoke method on null object

le_toubib

Active Member
Licensed User
Longtime User
hi falks
i'm trying to implement another date picker in a project.
it works perfectly ok ,
however , on the FIRST run on any device , i get this error :




if i close it and rerun , it shows perfectly thereafter.. the error is replicated on Same device if i uninstall/reinstall


what am i doing wrong ?
 

Mahares

Expert
Licensed User
Longtime User
here it is
When you post code for users to help you with, you should leave it there even after you were provided a solution. It may help someone else in the future. You should not remove it, just because your problem is solved. if you expect help from others, you should also give help.
 
Upvote 0

le_toubib

Active Member
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("1")
    SetTiledBackground(pnl_inputdata,LoadBitmap(File.DirAssets,"tile82x82.png"))
    SetTiledBackground(pnl_preview,LoadBitmap(File.DirAssets,"tile82x82.png"))
    SetTiledBackground(pnl_print,LoadBitmap(File.DirAssets,"tile82x82.png"))
    'SetTiledBackground(pnl_settings,LoadBitmap(File.DirAssets,"tile82x82.png"))

    If FirstTime Then
        SMTP.Initialize("smtp.gmail.com", 587, "", "", "SMTP")
        SMTP.StartTLSMode = True
    End If
    WebView1.Initialize("webview1")

    pnl_preview.AddView(WebView1,0,0,550dip,90%y)

    lst_prev_names.Initialize
    lst_places.Initialize
    lst_sources.Initialize

    readcomments
  

If File.Exists(File.DirRootExternal & dirname, "settings.ini") Then  
    readsettings
    readplaces
Else
    File.MakeDir(File.DirRootExternal,dirname)
    readsettings
    readplaces
End If

savesettings
    DateTime.DateFormat="dd-MM-yyyy"

    acet1.SetItems(lst_prev_names)
    acet2.SetItems(lst_places)
    createlabelsandspinners
  
    lbl_date.Text=lbl_date.Text & DateTime.Date(DateTime.Now)
    spn_test_type.Add("WISC")
    spn_test_type.Add("WAIS")
    spn_test_type.SelectedIndex=0

    'spn_test_type.Background=b_share.Background




End Sub


sure mate
 
Last edited by a moderator:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…