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 7958647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:27:15+00:00 2026-06-04T04:27:15+00:00

having a problem trying to get an arraylist containing arraylists to work in my

  • 0

having a problem trying to get an arraylist containing arraylists to work in my program, Im getting a strange warning saying: add @SuppressWarnings “null” to processArray(), regardless of If I add this or not my program crashes, Is there anything obvious that Im doing wrong here? any help would go a long way thanks.

      private ArrayList<ArrayList<String>> processArray(ResponseList<Status> responses){

      ArrayList<ArrayList<String>> mainArray = null;
      ArrayList<String> innerArrays = null;

      for (Status response: responses ){
          String name, status, imgUrl, time;

          name = response.getUser().getName();
          status = response.getText();
          imgUrl = response.getUser().getProfileImageURL().toString();
          time = response.getCreatedAt().toString();

          ArrayList<String> rtLinks = checkLinks(response.getText());

          if(rtLinks != null){

              for (String tLink: rtLinks){

                  innerArrays.add(name);
                  innerArrays.add(status);
                  innerArrays.add(imgUrl);
                  innerArrays.add(time);
                  innerArrays.add(tLink);

                  mainArray.add(innerArrays);

              }

          }


      }
    return mainArray;
  • 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-06-04T04:27:16+00:00Added an answer on June 4, 2026 at 4:27 am

    You never actually initialize either of those arraylists.

    You want

    ArrayList<ArrayList<String>> mainArray = new ArrayList<ArrayList<String>>(); // or new ArrayList<>() in java 7
    

    and inside the inner for loop:

    ArrayList<String> innerArrays = new ArrayList<String>(); // or new ArrayList<>() in java 7
    

    Also, don’t ever suppress warnings “just to make code work”. Only suppress them when you know exactly why they appear and exactly why you’re choosing to ignore them.

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

Sidebar

Related Questions

Hi everyone I am having a problem trying to get this to work. Basically
I'm having the following problem when trying to get Capifony to work deploying my
I am having a problem trying to get my program to keep information in
I'm having a problem trying to get a recursive method to work in rails/ruby.
I'm having a problem trying to get routing to work with ASP.NET MVC 3.0.
I am trying to get started with PEAR's HTML_QuickForm but I'm having a problem.
I am having a bit of a problem, I am trying to get a
I'm having an annoying problem trying to get an html page with a google
I'm new to php and MySQL and I'm having a problem trying to work
I'm having a problem with my autocompletetextview. I'm trying to get the autocomplete get

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.