Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Weather app troubles oh no

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to change the layout of my weather app and I get this error. I tracked it to the line setContentView(R.layout.change_city_layout);. Please help me with this.

 
Ranch Foreman
Posts: 313
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your xml code
 
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The lowest level of the posted stack trace says this:

Caused by: java.lang.NumberFormatException: Invalid float: "20.0dip"



So I expect that your XML (which Randy asked for) will contain that string somewhere. Whatever the "dip" at the end was supposed to mean, it doesn't belong there. The exception tells us that a float value was expected.
 
Bechir Mihoub
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's here

 
Randy Tong
Ranch Foreman
Posts: 313
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Paul mentioned, you have error which caused Invalid float: "20.0dip. Are you using it somewhere else?
 
Saloon Keeper
Posts: 2614
329
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Randy Tong wrote:As Paul mentioned, you have error which caused Invalid float: "20.0dip. Are you using it somewhere else?


I would guess that there is a resource file named something like: res/values/dimens.xml, and inside that is an entry for activity_horizontal_margin like this:Is dip still supported?  Try changing it to dp (same meaning) and if that helps.

Another thought - is activity_horizontal_margin allowed to be a decimal value?  If not, try changing it to 20dp.
 
Bechir Mihoub
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't find any 20dip in path finder.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!