0

I am Using APK Expansion File from http://developer.android.com/guide/market/expansion-files.html

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);

and m getting this NullPointerException in this line

   iv_new.setImageBitmap(bit);

and in XML my ImageView is :

 <ImageView android:id="@+id/iv_new"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>
Nikhil Lamba
  • 593
  • 1
  • 6
  • 17

1 Answers1

2

Did you call the setContentView(View) with the layout which contains the ImageView?

Ion Aalbers
  • 7,830
  • 3
  • 37
  • 50