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

  • Home
  • SEARCH
  • 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 7678243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:36:01+00:00 2026-05-31T17:36:01+00:00

Whi with this code public final String[] array_titoli_serie_prima = new String[]{ getResources().getString(R.string.titolo_p1), getResources().getString(R.string.titolo_p2), getResources().getString(R.string.titolo_p3),

  • 0

Whi with this code

public  final String[] array_titoli_serie_prima = new String[]{
        getResources().getString(R.string.titolo_p1),
        getResources().getString(R.string.titolo_p2),
        getResources().getString(R.string.titolo_p3),
        getResources().getString(R.string.titolo_p4),
        getResources().getString(R.string.titolo_p5),
        getResources().getString(R.string.titolo_p6),
        getResources().getString(R.string.titolo_p7),
        getResources().getString(R.string.titolo_p8),
        getResources().getString(R.string.titolo_p9),
        getResources().getString(R.string.titolo_p10),
        getResources().getString(R.string.titolo_p11),
        getResources().getString(R.string.titolo_p12),
        getResources().getString(R.string.titolo_p13),
        getResources().getString(R.string.titolo_p14),
        getResources().getString(R.string.titolo_p15),
        getResources().getString(R.string.titolo_p16),
        getResources().getString(R.string.titolo_p17),
        getResources().getString(R.string.titolo_p18),
        getResources().getString(R.string.titolo_p19),
        getResources().getString(R.string.titolo_p20),
        getResources().getString(R.string.titolo_p21),
        getResources().getString(R.string.titolo_p22)
    };

I have the error 03-20 00:46:02.120: E/AndroidRuntime(14847): java.lang.NullPointerException for all getResources line ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 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-31T17:36:03+00:00Added an answer on May 31, 2026 at 5:36 pm

    getResources() is a method of Context, so you can only do it like that in a class instance which subclasses Context, like an Activity.

    And actually you may want to look into String Array resources: http://developer.android.com/guide/topics/resources/string-resource.html#StringArray

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

Sidebar

Related Questions

Can anyone help me on a command whi will help in Searching a string
Given the following code: class monomial { public: mp_real coe; int exp; monomial *next;
Here is code: procedure DisableContrlOL(const cArray : array of string; ReEnable : boolean =
I've been working this issue for a while now and I am open to
UPDATE 6/25/10 Using Google , I am not the only person to encounter this
Dim flag As Boolean = True Dim fileName As String = Path.GetFileName(FileUpload1.PostedFile.FileName) Dim fileExtension
I'm using the Zend framework and the openid selector from http://code.google.com/p/openid-selector/ - however I
Code updated to working version. Thanks again for the help :) Hey guys. I
I'm having a bit of trouble trying to get this quicksort algorithm to work
This is my first time using splint (from Ubuntu repositories) and I immediately got

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.