Android Question reading NULL at Activity Resume KeyValueStore

Discussion in 'Android Questions' started by Electrocutioner, Jun 19, 2015.

  1. Electrocutioner

    Electrocutioner Member Licensed User

    I am having the invalid double error in the first read of the file using keyvaluestore.
    I am not sure how to check if the read is NULL I tried and I am getting a syntax error.

    If IsNumber(kvs.GetSimple("module_1_Addr))

    Sub Activity_Resume
    Module_1_ADDR = kvs.GetSimple("module_1_Addr")
    Module_2_ADDR = kvs.GetSimple("module_2_Addr"):
    Module_3_ADDR = kvs.GetSimple("module_3_Addr"):
    Module_4_ADDR = kvs.GetSimple("module_4_Addr"):

    End Sub
    Last edited: Jun 19, 2015
  2. Mahares

    Mahares Well Known Member Licensed User

    Did you try kvs.getobject instead of getsimple
  3. Erel

    Erel Administrator Staff Member Licensed User

    You can also check whether the key exists before trying to get the value:
    If kvs.ContainsKey ("module_1_Addr"Then ...
    anOparator and Peter Simpson like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice