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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:37:07+00:00 2026-06-18T11:37:07+00:00

I’m new to Android development and cant work out the issue here. I create

  • 0

I’m new to Android development and cant work out the issue here. I create a blank class called video with two properties name and url:

public class Video {
    public String _name;
    public String _Url;

    public Video(String name, String Url)
    {
        _name = name;
        _Url = Url;
    }
    public String getName()
    {
       return _name;
    }
    public String getUrl()
    {
       return _Url;
    }

}

I then have a generic list for adding videos to in an activity calls VideosListActivity, the error is being thrown when i add the video to the list:

public List<Video> ListResult;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //Update view

        setContentView(R.layout.videos);

        setTitle("VIDEOS");

        //--videos created here
        Video NewVideo = new Video("video one","http://www.youtube.com/watch?v=cxLG2wtE7TM");

        ListResult.add(NewVideo);

        Log.v("VideoList", "Opened list");

this error is what is thrown:

02-06 13:10:05.660: E/AndroidRuntime(23432): FATAL EXCEPTION: main
02-06 13:10:05.660: E/AndroidRuntime(23432): java.lang.RuntimeException: Unable to start activity ComponentInfo{uk.co.mosquitodigital.panic/uk.co.mosquitodigital.panic.VideoListActivity}: java.lang.NullPointerException
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2225)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2260)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.app.ActivityThread.access$600(ActivityThread.java:139)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.os.Handler.dispatchMessage(Handler.java:99)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.os.Looper.loop(Looper.java:156)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.app.ActivityThread.main(ActivityThread.java:5045)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at java.lang.reflect.Method.invokeNative(Native Method)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at java.lang.reflect.Method.invoke(Method.java:511)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at dalvik.system.NativeStart.main(Native Method)
02-06 13:10:05.660: E/AndroidRuntime(23432): Caused by: java.lang.NullPointerException
02-06 13:10:05.660: E/AndroidRuntime(23432):    at uk.co.mosquitodigital.panic.VideoListActivity.onCreate(VideoListActivity.java:31)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.app.Activity.performCreate(Activity.java:4543)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
02-06 13:10:05.660: E/AndroidRuntime(23432):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2181)
02-06 13:10:05.660: E/AndroidRuntime(23432):    ... 11 more
  • 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-18T11:37:08+00:00Added an answer on June 18, 2026 at 11:37 am

    you will need to initialize ListResult List before adding elements to it as :

    public List<Video> ListResult;
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
    
            //Update view
    
            setContentView(R.layout.videos);
    
            ListResult= new ArrayList<Video>();  //<< initialize List here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post

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.