Android Question how can I convert object to Int

Discussion in 'Android Questions' started by khosrwb, Jul 7, 2015.

  1. khosrwb

    khosrwb Active Member Licensed User

    hi
    how can I convert object to Int
    I need to use from this code
    Code:
    Dim b As Object

         b= listview4.GetItem(
    10)  
         d= List1.Get(b)
     
  2. eurojam

    eurojam Well-Known Member Licensed User

    may be something like this, but I am not sure...
    Code:
    If b Is Int Then
      
    Dim  i As Int = b
      d = list1.Get(i)
    End If
     
    khosrwb and DonManfred like this.
  3. Cableguy

    Cableguy Expert Licensed User

    This is a repost, the answer has already been given before!
     
  4. eurojam

    eurojam Well-Known Member Licensed User

    what does this mean?

    best regards
    stefan
     
  5. DonManfred

    DonManfred Expert Licensed User

    the answer has already been given before :D

    But to be honestly: Every third question is a Deja VU in this forum... :D
     
    RandomCoder and eurojam like this.
  6. Cableguy

    Cableguy Expert Licensed User

    Being asked the same question in a Forum by DIFFERENT persons is one thing, but having the exact same question being asked 3 times by the same user, giving the exact same snippet as example in less than 2weeks...
     
  7. eurojam

    eurojam Well-Known Member Licensed User

    ohh, I haven't realize this...I wasn't sure that my answer is correct, but then, it seems to be correct....that are the good news:D
     
    Cableguy likes this.
  8. khosrwb

    khosrwb Active Member Licensed User

    I try them but
    this code don't work for me
     
  9. Cableguy

    Cableguy Expert Licensed User

    Without the rest of the code, and working with what you have given us, you have had 3 different answers that work. You just have to adapt one to your code OR provide a bit more of your code, maybe even share the project as zip, so that someone can try to see what's keeping it from working as expected.
     
    RandomCoder, eurojam and DonManfred like this.
  10. Cableguy

    Cableguy Expert Licensed User

    And, to the best of my knowledge, an objet cannot be converted... It's value can.
     
Loading...