NullPointerException while setting Image in imageView from Bitmap?

Haty

New Member
I am Using APK Expansion File from http://developer.android.com/guide/market/expansion-files.htmlCODE :\[code\]String[] path= getAPKExpansionFiles(this,2,0);ZipResourceFile expansionFile;try { expansionFile = new ZipResourceFile(path[0]); InputStream fileStream = expansionFile.getInputStream("assets/Tablet/Chester_the_cat/chester_the_cat_2.png"); Bitmap bit=BitmapFactory.decodeStream(fileStream); iv_new=(ImageView)findViewById(R.id.iv_new); iv_new.setImageBitmap(bit);\[/code\]and m getting this NullPointerException in this line\[code\] iv_new.setImageBitmap(bit);\[/code\]and in XML my ImageView is :\[code\] <ImageView android:id="@+id/iv_new" android:layout_width="wrap_content" android:layout_height="wrap_content"/>\[/code\]
 
Back
Top