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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:05:11+00:00 2026-05-30T15:05:11+00:00

I’m getting errors like this when I run my app: 02-27 22:59:19.331: E/AndroidRuntime(2060): FATAL

  • 0

I’m getting errors like this when I run my app:

02-27 22:59:19.331: E/AndroidRuntime(2060): FATAL EXCEPTION: main
02-27 22:59:19.331: E/AndroidRuntime(2060): java.lang.NullPointerException
02-27 22:59:19.331: E/AndroidRuntime(2060):     
        at myPlanAdapter.getView(MyPlanActivity.java:145)
        02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.widget.AbsListView.obtainView(AbsListView.java:1315)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1198)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.widget.ListView.onMeasure(ListView.java:1109)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.view.View.measure(View.java:8171)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.view.View.measure(View.java:8171)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.view.View.measure(View.java:8171)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.view.View.measure(View.java:8171)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.view.ViewRoot.performTraversals(ViewRoot.java:801)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.os.Handler.dispatchMessage(Handler.java:99)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.os.Looper.loop(Looper.java:123)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at java.lang.reflect.Method.invokeNative(Native Method)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at java.lang.reflect.Method.invoke(Method.java:521)
    02-27 22:59:19.331: E/AndroidRuntime(2060):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

And my Source code is:

public class MyPlanActivity extends Activity implements OnItemClickListener,
        OnClickListener {
    private String TAG = "MyPlanActivity";
    private Button addButton = null;
    private ListView listView;
    myPlanAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        viewInit();
        adapter = new myPlanAdapter(getBaseContext());
        listView.setAdapter(adapter);
        listView.setOnItemClickListener(this);

    }

    private void viewInit() {
        setContentView(R.layout.myplan);
        addButton = (Button) findViewById(R.id.AddMyPlanButtonId);
        listView = (ListView) findViewById(R.id.myPlanListViewId);
        addButton.setOnClickListener(this);

    }

    public void onClick(View v) {
        switch (v.getId()) {
        case R.id.AddMyPlanButtonId:
            startActivity(new Intent(this, AddMyPlan.class));
            break;

        default:
            break;
        }
    }

    public void onItemClick(AdapterView<?> paramAdapterView, View paramView,
            int paramInt, long paramLong) {
        // TODO Auto-generated method stub

    }

    @Override
    protected void onResume() {
        super.onResume();
        adapter.notifyDataSetChanged();
    }

    private class myPlanAdapter extends ArrayAdapter<MyPlan> {
        Context context;
        MyPlanDataSource dataSource;

        public myPlanAdapter(Context context) {
            super(context, R.layout.myplan_list_view_entry);
            this.context = context;
            dataSource = new MyPlanDataSource(context);
        }

        private ArrayList<MyPlan> getAllPlan() {

            dataSource.open();
            ArrayList<MyPlan> allPlan = dataSource.getAllPlan();
            dataSource.close();
            Log.d(TAG,allPlan.get(0).getSubjectName());
            return allPlan;
        }

        @Override
        public int getCount() {
            Log.d(TAG,"Size: "+getAllPlan().size());
            return getAllPlan().size();
        }

        @Override
        public MyPlan getItem(int position) {
            return getAllPlan().get(position);
        }

        @Override
        public View getView(final int position, View convertView,
                ViewGroup parent) {
            View row = convertView;
            if (row == null)
            {
                LayoutInflater inflater = (LayoutInflater) context
                        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                row = inflater.inflate(R.layout.myplan_list_view_entry, parent,
                        false);

                final PlanViewHolder viewHolder = new PlanViewHolder();

                viewHolder.subjectName = (TextView) findViewById(R.id.myPlanListSubNameTextViewId);
                viewHolder.targetGrade = (TextView) findViewById(R.id.myPlanListTargetGradeTextViewId);
                viewHolder.duration = (TextView) findViewById(R.id.myPlanListDurationTextViewId);
                viewHolder.examDate = (TextView) findViewById(R.id.myPlanListExamDateTextViewId);
                viewHolder.daysTogo = (TextView) findViewById(R.id.myplanListDaystogoBoardTextViewId);
                viewHolder.delete = (ImageView) findViewById(R.id.myPlanDeleteImageViewId);
                Log.d(TAG, "" + position);

                row.setTag(viewHolder);
            }
            final PlanViewHolder holder = (PlanViewHolder) row.getTag();


            holder.subjectName.setText((getAllPlan().get(position) 
                    .getSubjectName())); // line 145
            holder.targetGrade.setText("Grade : "
                    + getAllPlan().get(position).getTargetGrade());
            holder.duration.setText(getAllPlan().get(position).getExamTime());
            holder.examDate.setText(getAllPlan().get(position).getExamDate());



            holder.daysTogo.setText(getAllPlan().get(position).getDaysTogo());

            holder.delete.setOnClickListener(new OnClickListener() {

                public void onClick(View v) {
                    AlertDialog.Builder builder = new AlertDialog.Builder(
                            context);
                    builder.setTitle("DELETE")
                            .setMessage(
                                    "Are you sure you want to delete this Subject?")
                            .setCancelable(false)
                            .setPositiveButton("Yes",
                                    new DialogInterface.OnClickListener()
                                    {
                                        public void onClick(
                                                DialogInterface dialog, int id)
                                        {

                                            dataSource.open();
                                            dataSource
                                                    .deletePlan(getItem(position));
                                            dataSource.close();
                                            notifyDataSetChanged();
                                        }
                                    })
                            .setNegativeButton("No",
                                    new DialogInterface.OnClickListener()
                                    {
                                        public void onClick(
                                                DialogInterface dialog, int id)
                                        {
                                            dialog.cancel();
                                        }
                                    });
                    AlertDialog alert = builder.create();
                    alert.show();

                }
            });


            return row;
        }
    }

    static class PlanViewHolder {
        private TextView subjectName;
        private TextView targetGrade;
        private TextView duration;
        private TextView examDate;
        private TextView daysTogo;
        private ImageView delete;
    }

}
  • 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-30T15:05:13+00:00Added an answer on May 30, 2026 at 3:05 pm

    I think you are searcing for your row views in the wrong place. Try to find them in your inflated row view(in the getView() method):

    viewHolder.subjectName = (TextView) row.findViewById(R.id.myPlanListSubNameTextViewId);
    viewHolder.targetGrade = (TextView) row.findViewById(R.id.myPlanListTargetGradeTextViewId);
    viewHolder.duration = (TextView) row.findViewById(R.id.myPlanListDurationTextViewId);
    viewHolder.examDate = (TextView) row.findViewById(R.id.myPlanListExamDateTextViewId);
    viewHolder.daysTogo = (TextView) row.findViewById(R.id.myplanListDaystogoBoardTextViewId);
    viewHolder.delete = (ImageView) findViewById(R.id.myPlanDeleteImageViewId);
    
    • 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
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I would like to run a str_replace or preg_replace which looks for certain words
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.