Android ZXing scanner activity transition not working
<p>I'm using a simple activity (from this <a href="https://github.com/dm77/barcodescanner" rel="nofollow">library</a>) with ZXing to scan a barcode.
Everything works fine, but the transition between the MainActivity and the ScannerActivity doesn't work well. Halfway through it gets interrupted. When going back from the ScannerActivity to the MainActivity the transition works like desired. Only while loading the barcodescanner it doesn't look really good.</p>

<p>Do you have any idea how to fix this?</p>

<p>MainActivity:</p>

<pre><code>private void invokeScanner() {
    try {
        Intent intent = new Intent(this, ScannerActivity.class);
        stealFocus(et_loadInput);
        startActivityForResult(intent,0);
        this.overridePendingTransition(R.anim.detail_anim_up, R.anim.detail_anim_down);
    } catch (Exception e){
        Log.e(TAG, "couldn't open scanner");
        e.printStackTrace();
        openAlertDialog(Const.MSG_PROCESSING_ERROR);
    }
}
</code></pre>

<p>ScannerActivity:</p>

<pre><code>public class ScannerActivity extends AbstractTitleBarActivity implements ZXingScannerView.ResultHandler{

private ZXingScannerView mScannerView;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mScannerView = new ZXingScannerView(this);
    setContentView(mScannerView);

    this.tv_backTitle.setText(getString(R.string.TITLE_SEARCH_VIEW));
    this.tv_heading.setText("");

    TextView titleClose = (TextView) findViewById(R.id.btn_close);
    titleClose.setVisibility(View.VISIBLE);
    titleClose.setOnClickListener(titleCloseListener);

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}

@Override
public void onResume() {
    super.onResume();
    mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results.
    mScannerView.startCamera();          // Start camera on resume
}

@Override
public void onPause() {
    super.onPause();
    mScannerView.stopCamera();           // Stop camera on pause
}

@Override
protected boolean isBackBtnVisible() {
    return false;
}

@Override
protected boolean isLogoVisible() {
    return false;
}

@Override
public void handleResult(Result rawResult) {

    Log.v(TAG, rawResult.getText()); // Prints scan results
    Log.v(TAG, rawResult.getBarcodeFormat().toString()); // Prints the scan format (qrcode, pdf417 etc.)
    MainActivity.scanVal = rawResult.toString();
    MainActivity.loadVal = MainActivity.scanVal;
    finish();
    overridePendingTransition(R.anim.detail_anim_back_down,R.anim.detail_anim_back_up);


}

// listener for close button
protected TextView.OnClickListener titleCloseListener = new TextView.OnClickListener() {
    public void onClick(View v) {
        finish();
        overridePendingTransition(
                R.anim.detail_anim_back_down, R.anim.detail_anim_back_up);
    }
};
</code></pre>

<p>}</p>