This is probably two questions in one….
Firstly i wonder how does android run the code, is it step by step. The reason i ask this is because at the moment what i am trying to do is decrypt an image and them display it. However, the problem i think is that the code is adding the bitmap image too fast before it is decrypted. Should it run the code line by line?
Secondly Eclipse gives stack error etc but i dont know how to read the stack, is there a way to set it to just say this is the line in the code which is causing the problem?
thanks
EDIT
DesEncrypter encrypter = new DesEncrypter();
File Directory = new File(Environment.getExternalStorageDirectory()+"/Temp");
FileInputStream iFile = new FileInputStream(new File("/sdcard/Images/"+Id+".jpg"));
FileOutputStream fos = new FileOutputStream(Directory+"/"+Id+".jpg");
encrypter.frontDecrypt(iFile, fos);
File file = new File(Environment.getExternalStorageDirectory()+"/Temp/"+Id+".jpg");
if(file.exists()){
bm = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory()+"/Temp/"+Id+".jpg");
}
else{
bm = BitmapFactory.decodeResource(getResources(), R.drawable.avatar);
}
}
catch(Exception e){}
iv.setImageBitmap(bm);
This code seems to work now and then, i think sometimes the bm isnt added correctly. Even if there is no image it should add one from the resource but does not do so.
Obviously code is executed line by line but there are some methods that runs async so they return immediately but execution still continues