Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Cannot use Random type

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm quite new at Java, although I have other programming experience.

I'm trying to compile a code sample, which makes use of the Random type. The problem is that Eclipse produces the following error message:

The import android.util.Random cannot be resolved

This seems, strange, because in the Type Hierarchy browser I can easily find the unit and the Random type. I'm using Eclipse Juno, 20121004-1855 with Android SDK at API level 17. Not sure what other information would be needed to resolve this error.

Any help is greatly appreciated!

Effel
 
Frits Broekhuis
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for bother you guys, I just found the solution: I should have imported java.util.Random, rather than android.util.Random!
 
I need a new interior decorator. This tiny ad just painted every room in my house purple.
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic