• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to insert data of arrayList in ListView

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I am trying to insert data of a Array List into ListView but it is showing problem.
Here is my xml file


and this is my Source file



But when i click on Insert Button on my activity it stops

Where am I going wrong?

Thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If an application crashes, the first thing you should always do is to read the logcat where the exception stack trace is recorded. That will tell you what kind of exception happened, and in which line of code.

In this case I bet it's a NullPointerException because you're calling a method on a null object reference.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!