Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

String not saved on Shared Preferences

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to save an email typed by a user. I get it correctly but when I want to save it on a Shared Preference I can't do it. The value is not saved.



The class Config:



The value of cr is correct but the value of CLAVE_NOMBRE is blank. There aren't errors.
How can I save the cr value on CLAVE_NOMBRE correctly?

Thanks.
 
Saloon Keeper
Posts: 6798
162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you made sure it's the if block in lines 40 to 44 that gets executed, and not the else block in 46?

Have you made sure that you're storing the value in the same preferences that you're trying to read it from?
 
Alex Munozz
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for answering. I fixed the problem. I had the idea that the first parameter of putstring mehtod is a variable and it's a xml label so I changed Config.CLAVE_NOMBRE to nombre.
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic