i created a little tabActivity application and like to run zxing and display the result without changing the tab using an ActivityGroup.
Everything works fine without the ActivityGroup.
And here’s some code of the my ScanActivity. If i “enable” the activityGroup i’ll never run into the onActivityResult…:
class ScanButtonClickListener implements OnClickListener {
@Override
public void onClick(View v) {
IntentIntegrator.initiateScan(BarcodeActivity.this);
}
}
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanResult =
IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
Log.v("barcode", scanResult.getContents().toString());
}
Here are parts of the manifest:
activity android:name=".barcode.BarcodeActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="portrait">
</activity>
<activity android:name=".tabGroups.BarcodeTabGroupActivity"></activity>
and the TabGroupActivity, which only launches the barcodeActivity for now:
public class BarcodeTabGroupActivity extends TabGroupActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
startChildActivity("BarcodeActivity", new Intent(this, BarcodeActivity.class));
}
}
And a filtered log:
08-04 15:59:02.093: DEBUG/DecodeHandler(4477): Found barcode in 1 ms
08-04 15:59:02.144: DEBUG/CaptureActivityHandler(4477): Got decode succeeded message
08-04 15:59:03.792: DEBUG/CaptureActivityHandler(4477): Got return scan result message
android::CameraHardwareSec::stopPreview() : preview not running, doing nothing
08-04 15:59:03.941: INFO/WindowManager(109): Setting rotation to 0, animFlags=1
08-04 15:59:03.957: INFO/ActivityManager(109): Config changed: { scale=1.0
imsi=0/0 loc=en_US touch=3 keys=1/1/2 nav=1/1 orien=1 layout=34
uiMode=17 seq=72}
I think it must be something with the ActivityManager.. as soon as zxing ends, it returns showing the button and no result.
Any tips? thanks in advanced!!
Ok, i managed to solve this problem on my own.
For everyone who’s interested in my solution, here it is:
Instead of initiate the scan on the child activity “BarcodeActivity”, i refered it to the parent activity:
And now it’s possible to access the result via onActivityResult within the parent BarcodeTabGroupActivity:
Within this onActivityResult i’m now able to start my next childActivity to process the scan results… don’t know if that’s good practice, but it works.
I thought i have to finish the other child activity using
but then it shoots down everything..