Activity does not starts
When i press button to start new activity, applications goes to main
activity instead.
I am really confused because, there is no any error. Also I have log
message in On create of desired activity - it does not pop up. Can you
please tell me what can cause such strange behaviour?
public void btnAtcEdit(View v) {
Log.d("ATS", "i tried to go to ATS believe me");
try {
Log.d("ATS", " i tried to go to ATS 2 believe me");
// convert bitmap to bytearray to pass them in intent
final BitmapDrawable bitmapDrawable1 = (BitmapDrawable) photo1
.getDrawable();
final Bitmap yourBitmap1 = bitmapDrawable1.getBitmap();
ByteArrayOutputStream stream1 = new ByteArrayOutputStream();
yourBitmap1.compress(Bitmap.CompressFormat.PNG, 90, stream1);
byte[] imm1 = stream1.toByteArray();
final BitmapDrawable bitmapDrawable2 = (BitmapDrawable) photo2
.getDrawable();
final Bitmap yourBitmap2 = bitmapDrawable2.getBitmap();
ByteArrayOutputStream stream2 = new ByteArrayOutputStream();
yourBitmap2.compress(Bitmap.CompressFormat.PNG, 90, stream2);
byte[] imm2 = stream2.toByteArray();
final BitmapDrawable bitmapDrawable3 = (BitmapDrawable) photo3
.getDrawable();
final Bitmap yourBitmap3 = bitmapDrawable3.getBitmap();
ByteArrayOutputStream stream3 = new ByteArrayOutputStream();
yourBitmap3.compress(Bitmap.CompressFormat.PNG, 90, stream3);
byte[] imm3 = stream3.toByteArray();
Intent i = new Intent(getApplicationContext(),
AddSaveActivity.class);
i.putExtra("photo1", imm1);
/*
putting more parameters
*/
i.putExtra("not_priceFor", not_priceFor);
startActivity(i);
stream1.flush();
stream1.close();
stream2.flush();
stream2.close();
stream3.flush();
stream3.close();
// finish();
} catch (Exception e) {
Log.d("ATS error", "before entered ATS");
e.printStackTrace();
}
}
AddSaveActivity
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.aadd_add_edit);
Log.d("ATS", "was started");
/*
some job
*/
}
No comments:
Post a Comment