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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:36:12+00:00 2026-05-26T01:36:12+00:00

well i don’t understand why i’m getting a Null Exception in my code :

  • 0

well i don’t understand why i’m getting a Null Exception in my code :

 public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;

        if (v == null) {
            LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.lista_comunidade, null);
        }
        Message o = items.get(position);
        if (o != null) {
            TextView tt = (TextView) v.findViewById(R.id.result_name);
            TextView t = (TextView) v.findViewById(R.id.TextView01);
            TextView bt = (TextView) v.findViewById(R.id.result_second_line);
            //bt.setTextSize(TypedValue.COMPLEX_UNIT_PX, 10);
            t.setTextSize(TypedValue.COMPLEX_UNIT_PX, 10);
            bt.setTextColor(-1);
            tt.setTextColor(-1);
            tt.setTextColor(-1);

            ImageView iv = (ImageView) v.findViewById(R.id.result_icon);

            iv.setImageResource(R.id.result_icon);
            if (tt != null) {
                tt.setText(o.getTitle());
            }
            if (bt != null) {
                bt.setText("Data: " + o.getDate().toString());

                }
            if(t != null){
                t.setText(o.getLink().toString());
            }
            }


        return v;
    }
}

My catlog says that :

 E/AndroidRuntime(  757): FATAL EXCEPTION: main
 E/AndroidRuntime(  757): java.lang.NullPointerException
 E/AndroidRuntime(  757):        at com.warriorpoint.androidxmlsimple.MessageList
 $SiteAdapter.getView(MessageList.java:182)

Line 182 is :

 TextView t = (TextView) v.findViewById(R.id.TextView01);

And i have this in my xml :

  <TextView android:text="@string/Text" android:layout_width="wrap_content" android:id="@+id/textView1" android:layout_height="wrap_content" android:layout_alignParentBottom="true"></TextView>

What i’m missing? thanks

  • 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-05-26T01:36:12+00:00Added an answer on May 26, 2026 at 1:36 am

    Line 182 is TextView t = (TextView) v.findViewById(R.id.TextView01);
    The id in your layout is @+id/textView1

    It seems that you have TextView01 elsewhere in your resources (allowing the code to compile), but not within the current layout.

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

Sidebar

Related Questions

Well I am using the following code to redirect users who don't have my
It seems I don't understand javascript callbacks quite as well as I thought. In
Well I don't actually want to make a calendar but I need a view
I don't well understand the difference betweeen these two lock classes. In boost documentation
My question concerns c# and how to access Static members ... Well I don't
Well i need some help here i don't know how to solve this problem.
I don't know if this is a well known 'thing' or something new in
Well, I don't know if I'm completely wrong, but I really can't find a
Well, I don't know if strong naming is the right term, but what I
Maybe I just don't know .NET well enough yet, but I have yet to

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.