Getting NullPointerException from ImageAdapter Class?

Just try to replace this code Activity m; public ImageAdapter1(Activity c){ m = c; } in place of Context m; public ImageAdapter1(Context c){ m = c; } Hope this works.

Since Activity is child of Context so both are correct. – Adil Soomro Jul 14 at 7:16 And ImageAdapter1 as subclass of BaseAdapter will need Context as parameter in constructor – Adil Soomro Jul 14 at 7:23.

Just remove the lines public ImageAdapter1(ImageSwitcherActivity imageSwitcherActivity) { // TODO Auto-generated constructor stub } because it is called as constructor but doesn't set Context m to your ImageSwitcherActivity. Since Context is null it leads to NullPointerException.

Or put 'm = imageSwitcherActivity' in the constructor... However, if this constructor is never called, this is not the cause of your problem... – Fortega Jul 14 at 7:36.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions