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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:24:32+00:00 2026-06-01T16:24:32+00:00

i see a weird bug here.. i have a list view which is populated

  • 0

i see a weird bug here.. i have a list view which is populated from the server in an async… it populates first and then displays the list view… but when i scroll down it crashes… from the logs i see it is not related to population of list view and all.. … can you please help me?

04-12 12:39:54.676: E/AndroidRuntime(1984): FATAL EXCEPTION: main
04-12 12:39:54.676: E/AndroidRuntime(1984): java.lang.NullPointerException
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.widget.AbsListView.obtainView(AbsListView.java:1304)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.widget.ListView.makeAndAddView(ListView.java:1727)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.widget.ListView.fillUp(ListView.java:682)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.widget.ListView.correctTooHigh(ListView.java:1349)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.widget.ListView.fillGap(ListView.java:624)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2944)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.widget.AbsListView.onTouchEvent(AbsListView.java:2065)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.widget.ListView.onTouchEvent(ListView.java:3315)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.view.View.dispatchTouchEvent(View.java:3766)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.os.Looper.loop(Looper.java:123)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at android.app.ActivityThread.main(ActivityThread.java:4627)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at java.lang.reflect.Method.invokeNative(Native Method)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at java.lang.reflect.Method.invoke(Method.java:521)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
04-12 12:39:54.676: E/AndroidRuntime(1984):     at dalvik.system.NativeStart.main(Native Method)

this is the custom adapter class which extends Base Adapter

@Override
public int getCount() {

    return mAppIconMapList.size();
}

@Override
public Object getItem(int position) {

    return mAppIconMapList.get(position);
}

public Object getAppName(int position) {

    return mAvaiableApps.get(position);
}

@Override
public long getItemId(int position) {

    return position;
}

@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    // sets the view onto list view
    LinearLayout rowLayout = null;

    System.out.println("getView " + position + " " + convertView);

    if (convertView == null) {
        // inflating the row
        rowLayout = (LinearLayout) mInflater.inflate(
                R.layout.list_custom_row, parent, false);

        mAppIcon = (ImageView) rowLayout.findViewById(R.id.icon);
        mAppName = (TextView) rowLayout.findViewById(R.id.application);
        mAppName.setTextColor(Color.WHITE);
        mAppHint = (TextView) rowLayout.findViewById(R.id.hint);
        mAppHint.setTextColor(Color.WHITE);
        mDownloadButton = (Button) rowLayout.findViewById(R.id.download);
        mDownloadButton.setFocusable(false);

    }
    // else
    // convertView.getTag();


    mIcon = mAppIconMapList.get(position);
    System.out.println("Icon " + mIcon);
    mCurrentApplication = mAvaiableApps.get(position);
    System.out.println("Current App " + mCurrentApplication);
    mAppIcon.setImageBitmap(mIcon.get(mCurrentApplication));
    mAppName.setText(mCurrentApplication.replace(".apk", ""));
    mAppHint.setText("Click here to view Description");

    return rowLayout;
}

And this is how i am calling

mCustomAdapter = new BWCustomAdapter(mCategory, avaiableApps,
                            appIconMap, BWListApplication.this);
                    setListAdapter(mCustomAdapter);

and this is my list view

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="450dip"
    android:layout_height="300dip"
    android:orientation="vertical" >

    <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:fadingEdge="none"
        android:listSelector="@drawable/list_selector" />
</LinearLayout>
  • 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-01T16:24:34+00:00Added an answer on June 1, 2026 at 4:24 pm

    You should really use the ViewHolder pattern. But that is not reason you see a null pointer.
    You need to assign a value to rowLayout at all times.

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        // sets the view onto list view
        LinearLayout rowLayout = null;
    
        System.out.println("getView " + position + " " + convertView);
    
        if (convertView == null) {
            // inflating the row
            rowLayout = (LinearLayout) mInflater.inflate(
                    R.layout.list_custom_row, parent, false);
    
    
        } else {
            rowLayout = convertView;
        }
        mAppIcon = (ImageView) rowLayout.findViewById(R.id.icon);
        mAppName = (TextView) rowLayout.findViewById(R.id.application);
        mAppName.setTextColor(Color.WHITE);
        mAppHint = (TextView) rowLayout.findViewById(R.id.hint);
        mAppHint.setTextColor(Color.WHITE);
        mDownloadButton = (Button) rowLayout.findViewById(R.id.download);
        mDownloadButton.setFocusable(false);
    
    
        mIcon = mAppIconMapList.get(position);
        System.out.println("Icon " + mIcon);
        mCurrentApplication = mAvaiableApps.get(position);
        System.out.println("Current App " + mCurrentApplication);
        mAppIcon.setImageBitmap(mIcon.get(mCurrentApplication));
        mAppName.setText(mCurrentApplication.replace(".apk", ""));
        mAppHint.setText("Click here to view Description");
    
        return rowLayout;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a bug where I have an MFC application that does weird
I got a weird bug. In my .css file I have the following rule:
A weird bug was occurring in production which I was asked to look into.
I have a very weird bug that I can't seem to figure out. I
Ok so this bug is very weird here is my code, you can actually
I have a really weird bug and cant figure out why things are not
I see this header appended to the response from apache. Does it have any
This is really weird, and I cannot see why this is happening. In the
Today I ran into something a bit weird. I used mini-profiler to see the
while exploring jQuery I came up with the following weird script. I don't see

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.