Android NullPointerException CipherInputStream to Bitmap?

If the first class is not really an activity, doen't extend activity just to use this.getAssets() pass the context (i.e. Your activity) when instantiating the class, and use this instance to call getAssets().

If the first class is not really an activity, doen't extend activity just to use this.getAssets(), pass the context (i.e. Your activity) when instantiating the class, and use this instance to call getAssets().

I didn't get what you mean at all..Yes,the ImageLoader class is not an activity. The problem I guess is in calling this.getAssets(); I tried with changing getBitmap method like getBitmap(Context contect,String src) and change AssetManager to context.getAssets(); but it's still wasn't working – psychenaut Aug 11 at 11:45 Get rid of extends Activity. And put AssetManager is = context.getAssets() – JJG Aug 11 at 11:48 I did it and I still got the Exception + 2 more exceptions about cipherinputstream and bufferedinputstream.

– psychenaut Aug 11 at 11:59 please see my revised answer – JJG Aug 11 at 13:00.

You need an onCreate() method. @Override public void onCreate(Bundle savedInstanceState) { super. OnCreate(savedInstanceState); AssetManager am = getAssets();//this should not get a nullpointerexception } Or do the following: In your Activity (whichever one calls image loader) write this: ImageLoader il = new ImageLoader(this);//this being the context.

Then in your ImageLoader class you can use AssetManager am = context.getAssets();//context being the activity which called this class.

– JJG Aug 11 at 11:40 I call it like this : imageLoader=new ImageLoader(activity. GetApplicationContext()); – psychenaut Aug 11 at 11:46 In imageloader use AssetManager is = context.getAssets(); – JJG Aug 11 at 11:50.

This should be replaced with something like SoftReference or BitmapOptions. //Make the background thead low priority. Final int stub_id=R.drawable.

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