Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4273006
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:39:17+00:00 2026-05-21T07:39:17+00:00

Thanks for looking. I’m trying to put together a simple live wallpaper, and trying

  • 0

Thanks for looking.

I’m trying to put together a simple live wallpaper, and trying different methods for optimizing the speed of it. I’m bumbling around a bit, though, so forgive the simpleness of the question.

I’m trying to grab resourceIds by using (this code runs in the class CubeEngine(), which as you can guess I’m just working straight off the Cube demo)

private Resources res;
private int[] resID;
resID[0] = res.getIdentifier("n01","drawable",getPackageName());

Now I have 11 images I would like to load, and so I have 10 of that final line there. I know I could loop it, but I wanted to make it as simple as possible for the first go-round. The problem is that this returns a NullPointerException on execution. The image(s) in question are in res/drawable, and I have had no trouble accessing them before directly, as in

resBMP = BitmapFactory.decodeResources(res, R.drawable.n01);

for example. I’m guessing there is some simple thing that I am missing to get this working. I spend just about every day in MATLAB but haven’t worked with a language like java in many years, so even if it’s something as simple as syntactical error don’t overlook it and don’t hesistate to tell me of it!

Ernest’s comment solved the problem immediately.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:39:17+00:00Added an answer on May 21, 2026 at 7:39 am

    Did you allocate resID (resID = new int[10]) somewhere? If the NullPointerException is on that line, then either resID or res is null.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

thanks for looking, I've had a terrible time trying to get the right search
Thanks for looking. I am trying to get the smallest time between visits per
Thanks for looking into this. Basically, what I am trying to do is to
Hello everyone thanks for looking into my problem. What I am trying to do
Hey guys, and thanks for looking. I have built the simple D2D app from
Thanks for looking at my dilemma. I'm trying to make an SVG menu with
Thanks for looking, I'm trying to get 20 entries from the database randomly and
Hi and thanks for looking! Background I have made a simple little app in
Thanks for looking. All sincerely helpful answers are voted up. I use a password
Thanks for looking, all helpful answers are voted up. This is my markup. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.