I show the images on listview and call lazy loadiing in list Adapter class, for the show images on list view it,s working fine . Means Images load properly.
But i implement list view on item click listener and image url pass to another class and again i call lazy loading same as list adapter class
` imageLoader.DisplayImage(strimg.trim(), imgview);`
Then error occur
java.lang.NullPointerException
My Java Code
public class Description extends Activity
{
public ImageLoader imageLoader;
ImageView imgview;
String strimg;
Context context=this;
TextView
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.details);
imgview= (ImageView) findViewById(R.id.descimg);
try
{
Bundle bundle=getIntent().getExtras();
if(bundle != null)
{
strimg= bundle.getString("ImageUrl");
Log.d("DescImg", "strimg");
}
else {
Toast.makeText(context, "Image"+strimg, Toast.LENGTH_LONG).show();
Toast.makeText(context, "NUll", Toast.LENGTH_LONG).show();
}
Log.d("Desc", strimg);
imageLoader.DisplayImage(strimg.trim(), imgview);
}
catch(Exception e)
{
Log.d("DescError"+e, strimg);
}
}
Pass Image Url
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Intent i= new Intent(PropertySearch.this,Description.class);
i.putExtra("ImageUrl", strimage[position]);
startActivity(i);
}
});
Please Suggest me How i can fix this problem
Thanks In Advance.