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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:16:28+00:00 2026-06-07T00:16:28+00:00

I’m trying to launch an activity from a custom lisview. I have hoded the

  • 0

I’m trying to launch an activity from a custom lisview. I have hoded the onItemclick method nd called the class by creating a new intent!

public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {

    if (position == 0) {
        Intent i = new Intent(getApplicationContext(), InstalledApps.class);
        startActivity(i);
    }
}

but when I try to launch it, it gives me a nullpointer exception. what I’m trying to do is, get the position of the clicked item and direct it to the correct activity by an if clause. the following is the log cat output.

07-05 04:39:52.718: W/dalvikvm(3189): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
07-05 04:39:52.758: E/AndroidRuntime(3189): FATAL EXCEPTION: main
07-05 04:39:52.758: E/AndroidRuntime(3189): java.lang.NullPointerException
07-05 04:39:52.758: E/AndroidRuntime(3189):     at com.sliit.droidman.thirdpartyapplist.ListViewAdapter.getView(ListViewAdapter.java:69)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.widget.AbsListView.obtainView(AbsListView.java:2267)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1244)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.widget.ListView.onMeasure(ListView.java:1156)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.View.measure(View.java:15172)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at     android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.View.measure(View.java:15172)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.View.measure(View.java:15172)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:833)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.View.measure(View.java:15172)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2148)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.View.measure(View.java:15172)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1848)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1100)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1273)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.Choreographer.doCallbacks(Choreographer.java:555)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.Choreographer.doFrame(Choreographer.java:525)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.os.Handler.handleCallback(Handler.java:615)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.os.Handler.dispatchMessage(Handler.java:92)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.os.Looper.loop(Looper.java:137)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at android.app.ActivityThread.main(ActivityThread.java:4745)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at java.lang.reflect.Method.invokeNative(Native Method)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at java.lang.reflect.Method.invoke(Method.java:511)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-05 04:39:52.758: E/AndroidRuntime(3189):     at dalvik.system.NativeStart.main(Native Method)

please let me know what I’m doing wrong here!

the adapter class.

 package com.sliit.droidman.thirdpartyapplist;
 import com.sliit.droidman.R;

 import android.app.Activity;  
 import android.graphics.drawable.Drawable;
 import android.view.LayoutInflater;  
 import android.view.View;  
 import android.view.ViewGroup;  
 import android.widget.BaseAdapter;  
 import android.widget.ImageView;
 import android.widget.TextView;  

 public class ListViewAdapter extends BaseAdapter  
 {  
Activity context;  
String title[];  
String description[];
Drawable icon[];

public ListViewAdapter(Activity context, String[] title, String[] description , Drawable[] ico) {  
    super();  
    this.context = context;  
    this.title = title;  
    this.description = description;
    this.icon = ico;
}  

public int getCount() {  
    // TODO Auto-generated method stub  
    return title.length;  
}  

public Object getItem(int position) {  
    // TODO Auto-generated method stub  
    return null;  
}  

public long getItemId(int position) {  
    // TODO Auto-generated method stub  
    return 0;  
}  

private class ViewHolder {  
    TextView txtViewTitle;  
    TextView txtViewDescription;
    ImageView image;
}  

public View getView(int position, View convertView, ViewGroup parent)  
{  
    // TODO Auto-generated method stub  
    ViewHolder holder;  
    LayoutInflater inflater =  context.getLayoutInflater();  

    if (convertView == null)  
    {  
        convertView = inflater.inflate(R.layout.listitem_row, null);  
        holder = new ViewHolder();  
        holder.txtViewTitle = (TextView) convertView.findViewById(R.id.appname);  
        holder.txtViewDescription = (TextView) convertView.findViewById(R.id.packagename);
        holder.image = (ImageView) convertView.findViewById(R.id.avatar);
        convertView.setTag(holder);  
    }  
    else  
    {  
        holder = (ViewHolder) convertView.getTag();  
    }  

    holder.txtViewTitle.setText(title[position]);  
    holder.txtViewDescription.setText(description[position]);
    holder.image.setImageDrawable(icon[position]);

return convertView;  
}  

 }  
  • 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-07T00:16:30+00:00Added an answer on June 7, 2026 at 12:16 am

    07-05 04:39:52.758: E/AndroidRuntime(3189): at com.sliit.droidman.thirdpartyapplist.ListViewAdapter.getView(ListViewAdapter.java:69)

    You have a null pointer at line 69 of com.sliit.droidman.thirdpartyapplist.ListViewAdapter‘s getView method. Figure out what’s causing that null pointer and make sure it doesn’t happen.

    It appears that line 69 is the following

        holder.txtViewTitle.setText(title[position]);  
    

    Some things that might cause this:

    • Perhaps the title array is null. I think if it were just that the position argument were too large, you’d get an ArrayIndexOutOfBoundsException instead.
    • The txtViewTitle member of the holder instance is null, possibly because the id R.id.appname is incorrect in line 59.

    You can figure this out by putting a breakpoint on line 69 in the debugger and inspecting the values of holder.txtViewTitle and title.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a view passing on information from a database: def serve_article(request, id): served_article
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.