Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Trying to get in to this activity:

http://i.imgur.com/WmBd01i.png

but getting the following error in my logcat:

Java
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wlodsgn.bunbunup/com.wlodsgn.bunbunup.JeansDetailsActivity}: java.lang.NullPointerException
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2202)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2252)
                at android.app.ActivityThread.access$800(ActivityThread.java:139)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1200)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5103)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
                at dalvik.system.NativeStart.main(Native Method)
         Caused by: java.lang.NullPointerException
                at com.wlodsgn.bunbunup.JeansDetailsActivity.onCreate(JeansDetailsActivity.java:71)
                at android.app.Activity.performCreate(Activity.java:5275)
                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2166)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2252)
                at android.app.ActivityThread.access$800(ActivityThread.java:139)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1200)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5103)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
                at dalvik.system.NativeStart.main(Native Method)


The error shows whenever I click from my `Listview` to the `Activity` I showed below and it crashes when trying to show it but it does not crash the whole app.

This where it says the error is located:

ImageLoader imageLoaderFS = AppController.getInstance().getImageLoader();
String bitmapfull = i.getStringExtra("imagefs");
NetworkImageView thumbNailFS = (NetworkImageView) findViewById(R.id.thumbnailFS);
thumbNailFS.setImageUrl(bitmapfull, imageLoaderFS);

Any help would be appreciated

Here is the code for the rest of that activity if needed

Java
import android.content.Intent;
    import android.os.Bundle;
    import android.support.v7.app.ActionBar;
    import android.support.v7.app.ActionBarActivity;
    import android.view.View;
    import android.widget.AdapterView;
    import android.widget.TextView;
    
    import com.android.volley.toolbox.NetworkImageView;
    import com.android.volley.toolbox.ImageLoader;
    import com.wlodsgn.bunbunup.adapter.CustomListAdapter;
    import com.wlodsgn.bunbunup.adapter.FlickrAdapter;
    import com.wlodsgn.bunbunup.app.AppController;
    import com.wlodsgn.bunbunup.model.Jeans;
    
    /**
     * Created by WiLo on 3/4/2015.
     */
    public class JeansDetailsActivity extends ActionBarActivity {
        private static String Titulo="titulo";
        private static String Marca="marca";
        private static String Colour="color";
        private static String Tipo="tipo";
        private static String Referencia="ref";
    
        private static String bitmapfull="thumbnailUrlFS";
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_jeansdetails);
            /**getSupportActionBar().hide();**/
    
            ListOrGridItemClickListener listener = new ListOrGridItemClickListener();
    
            //Back button
            ActionBar actionBar = getSupportActionBar();
            actionBar.setDisplayHomeAsUpEnabled(true);
    
            Intent i=getIntent();
            String titulo = i.getStringExtra(Titulo);
            TextView titleName = (TextView) findViewById(R.id.titulo);
            titleName.setText(titulo);
    
            String marca = i.getStringExtra(Marca);
            TextView marcaName = (TextView) findViewById(R.id.marca);
            marcaName.setText(marca);
    
            String color = i.getStringExtra(Colour);
            TextView colorName = (TextView) findViewById(R.id.color);
            colorName.setText(color);
    
            String tipo = i.getStringExtra(Tipo);
            TextView tipoName = (TextView) findViewById(R.id.tipo);
            tipoName.setText(tipo);
    
            String ref = i.getStringExtra(Referencia);
            TextView refName = (TextView) findViewById(R.id.ref);
            refName.setText(ref);
    
            ImageLoader imageLoader = AppController.getInstance().getImageLoader();
            String bitmap = i.getStringExtra("image");
            NetworkImageView thumbNail = (NetworkImageView) findViewById(R.id.thumbnail);
            thumbNail.setImageUrl(bitmap, imageLoader);
    
            ImageLoader imageLoaderFS = AppController.getInstance().getImageLoader();
            String bitmapfull = i.getStringExtra("imagefs");
            NetworkImageView thumbNailFS = (NetworkImageView) findViewById(R.id.thumbnailFS);
            thumbNailFS.setImageUrl(bitmapfull, imageLoaderFS);
    
            ImageLoader imageLoader2 = AppController.getInstance().getImageLoader();
            String bitmap2 = i.getStringExtra("image2");
            NetworkImageView thumbNail2 = (NetworkImageView) findViewById(R.id.thumbnail2);
            thumbNail2.setImageUrl(bitmap2, imageLoader2);
    
            ImageLoader imageLoader3 = AppController.getInstance().getImageLoader();
            String bitmap3 = i.getStringExtra("image3");
            NetworkImageView thumbNail3 = (NetworkImageView) findViewById(R.id.thumbnail3);
            thumbNail3.setImageUrl(bitmap3, imageLoader3);
    
        }
    
        private class ListOrGridItemClickListener implements AdapterView.OnItemClickListener {
    
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent = new Intent(JeansDetailsActivity.this, JnsDetailFSViewActivity.class);
                /**NetworkImageView photo = CustomListAdapter.getItem(position);**/
                /**bitmapfull = ((String) FlickrAdapter.get(position)).getThumbnailUrlFS();**/
                intent.putExtra(JnsDetailFSViewActivity.EXTRA_IMAGE_URL, bitmapfull);
    
    
                startActivity(intent);
            }
    
        }
    
    
    
        public void onClickHandler(View v){
            switch(v.getId()){
                case R.id.thumbnail:
                    startActivity(new Intent(this,JeansActivity.class));
    
                case R.id.thumbnail2:
                    startActivity(new Intent(this,JeansActivity.class));
    
                case R.id.thumbnail3:
                    startActivity(new Intent(this,JeansActivity.class));
    
                /**case R.id.thumbnailFS:
                    startActivity(new Intent(this,JeansActivity.class));**/
            }
    
        }
    
    
    
    }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900