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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:32:37+00:00 2026-06-06T15:32:37+00:00

Solution: Make sure nothing is null! I have a ListView throwing a NullPointerException, and

  • 0

Solution: Make sure nothing is null!

I have a ListView throwing a NullPointerException, and I can’t find out what I’m doing wrong.

The error occurs when I scroll to the bottom of the ListView

My code is at: BluetoothChat.java

The relevant portion (where I mess w/the adapter):

songs = cmd.songs;
mAdapter = new ArrayAdapter(
    this,
    android.R.layout.simple_list_item_1,
    songs);
mAdapter.notifyDataSetChanged();
library.setAdapter(mAdapter);

Logcat:

E/BluetoothChat(11304): +++ ON CREATE +++
E/BluetoothChat(11304): ++ ON START ++
E/BluetoothChat(11304): + ON RESUME +
E/BluetoothChat(11304): - ON PAUSE -
E/BluetoothService.cpp(  229): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothChat(11304): + ON RESUME +
E/BluetoothService.cpp(  229): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothEventLoop.cpp(  229): onCreateDeviceResult: D-Bus error: org.bluez.Error.AlreadyExists (Already Exists)
E/BluetoothService.cpp(  229): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothChatService(11304): accept() failed
E/BluetoothChatService(11304): java.io.IOException: Operation Canceled
E/BluetoothChatService(11304): at android.bluetooth.BluetoothSocket.acceptNative(Native Method)
E/BluetoothChatService(11304): at android.bluetooth.BluetoothSocket.accept(BluetoothSocket.java:311)
E/BluetoothChatService(11304): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:113)
E/BluetoothChatService(11304): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:99)
E/BluetoothChatService(11304): at com.winograd.mp3remote.BluetoothChatService$AcceptThread.run(BluetoothChatService.java:257)
W/dalvikvm(11304): threadid=1: thread exiting with uncaught exception (group=0x40a391f8)
E/AndroidRuntime(11304): FATAL EXCEPTION: main
E/AndroidRuntime(11304): java.lang.NullPointerException
E/AndroidRuntime(11304): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:394)
E/AndroidRuntime(11304): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
E/AndroidRuntime(11304): at android.widget.AbsListView.obtainView(AbsListView.java:2037)
E/AndroidRuntime(11304): at android.widget.ListView.makeAndAddView(ListView.java:1772)
E/AndroidRuntime(11304): at android.widget.ListView.fillDown(ListView.java:672)
E/AndroidRuntime(11304): at android.widget.ListView.fillGap(ListView.java:636)
E/AndroidRuntime(11304): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4581)
E/AndroidRuntime(11304): at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:2877)
E/AndroidRuntime(11304): at android.widget.AbsListView.onTouchEvent(AbsListView.java:3131)
E/AndroidRuntime(11304): at android.view.View.dispatchTouchEvent(View.java:5541)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1951)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1712)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
E/AndroidRuntime(11304): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
E/AndroidRuntime(11304): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1912)
E/AndroidRuntime(11304): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371)
E/AndroidRuntime(11304): at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
E/AndroidRuntime(11304): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1860)
E/AndroidRuntime(11304): at android.view.View.dispatchPointerEvent(View.java:5721)
E/AndroidRuntime(11304): at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2890)
E/AndroidRuntime(11304): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2466)
E/AndroidRuntime(11304): at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:845)
E/AndroidRuntime(11304): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2475)
E/AndroidRuntime(11304): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(11304): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(11304): at android.app.ActivityThread.main(ActivityThread.java:4575)
E/AndroidRuntime(11304): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(11304): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(11304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime(11304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(11304): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(  229):   Force finishing activity com.winograd.mp3remote/.BluetoothChat
W/ActivityManager(  229): Activity pause timeout for ActivityRecord{4188fd40 com.winograd.mp3remote/.BluetoothChat}
E/LockScreen(  229): NameNotFoundException: [**null**]
W/InputManagerService(  229): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@474adcd0
E/LockScreen(  229): NameNotFoundException: [**null**]
W/IInputConnectionWrapper( 9205): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper( 9205): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper( 9205): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 9205): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 9205): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper( 9205): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 9205): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 9205): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 9205): endBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 9205): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper( 9205): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 9205): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 9205): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 9205): endBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 9205): getExtractedText on inactive InputConnection
W/ActivityManager(  229): Activity destroy timeout for ActivityRecord{4188fd40 com.winograd.mp3remote/.BluetoothChat}
E/LockScreen(  229): NameNotFoundException: [**null**]
E/LockScreen(  229): NameNotFoundException: [**null**]
W/InputManagerService(  229): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@461df6d0
E/BluetoothChat(11327): +++ ON CREATE +++
E/BluetoothChat(11327): ++ ON START ++
E/BluetoothChat(11327): + ON RESUME +
E/BluetoothChat(11327): - ON PAUSE -
E/BluetoothService.cpp(  229): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothChat(11327): + ON RESUME +
E/BluetoothService.cpp(  229): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothEventLoop.cpp(  229): onCreateDeviceResult: D-Bus error: org.bluez.Error.AlreadyExists (Already Exists)
E/BluetoothService.cpp(  229): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothChatService(11327): accept() failed
E/BluetoothChatService(11327): java.io.IOException: Operation Canceled
E/BluetoothChatService(11327): at android.bluetooth.BluetoothSocket.acceptNative(Native Method)
E/BluetoothChatService(11327): at android.bluetooth.BluetoothSocket.accept(BluetoothSocket.java:311)
E/BluetoothChatService(11327): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:113)
E/BluetoothChatService(11327): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:99)
E/BluetoothChatService(11327): at com.winograd.mp3remote.BluetoothChatService$AcceptThread.run(BluetoothChatService.java:257)
W/dalvikvm(11327): threadid=1: thread exiting with uncaught exception (group=0x40a391f8)
E/AndroidRuntime(11327): FATAL EXCEPTION: main
E/AndroidRuntime(11327): java.lang.NullPointerException
E/AndroidRuntime(11327): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:394)
E/AndroidRuntime(11327): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
E/AndroidRuntime(11327): at android.widget.AbsListView.obtainView(AbsListView.java:2037)
E/AndroidRuntime(11327): at android.widget.ListView.makeAndAddView(ListView.java:1772)
E/AndroidRuntime(11327): at android.widget.ListView.fillDown(ListView.java:672)
E/AndroidRuntime(11327): at android.widget.ListView.fillGap(ListView.java:636)
E/AndroidRuntime(11327): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4581)
E/AndroidRuntime(11327): at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:3848)
E/AndroidRuntime(11327): at android.os.Handler.handleCallback(Handler.java:605)
E/AndroidRuntime(11327): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(11327): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(11327): at android.app.ActivityThread.main(ActivityThread.java:4575)
E/AndroidRuntime(11327): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(11327): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(11327): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime(11327): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(11327): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(  229):   Force finishing activity com.winograd.mp3remote/.BluetoothChat
W/ActivityManager(  229): Activity pause timeout for ActivityRecord{473f2238 com.winograd.mp3remote/.BluetoothChat}
W/ResourceType(  229): Invalid package identifier when getting bag for resource number 0x7f0c0009
W/InputManagerService(  229): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43c28e60
W/ActivityManager(  229): Activity destroy timeout for ActivityRecord{473f2238 com.winograd.mp3remote/.BluetoothChat}

Any help/tip is greatly appreciated!

  • 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-06T15:32:39+00:00Added an answer on June 6, 2026 at 3:32 pm

    as the error is in ArrayAdapter.getView(ArrayAdapter.java:362) so looks any of the element of songs is null, as ArrayAdapter uses element.toString() in the getView function..

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

Sidebar

Related Questions

SOLUTION Make sure in the plist that the storyboard name is listed as the
I've searched other questions but can't find a workable solution. This is a CMS
I have a problem that I cannot seem to find a solution for. I
I've been looking for a solution to make my NSTextField bottom-aligned and I've found
I'm having trouble with Poco libraries. I need a simple solution to make the
I just tried to Make a solution on VS 2010 to practice consuming REST
What is the best solution if I want to make a OnTouch event repeat
I'm trying to make a css background flash between two colours. The best solution
There are 3 Projects in 1 Solution. Main manipulations I make from the main
In this SO thread, Brian Postow suggested a solution involving fake anonymous functions: make

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.