Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8369017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:32:17+00:00 2026-06-09T13:32:17+00:00

I have 2 different Layouts One is a TabHost which hosts different tabs where

  • 0

I have 2 different Layouts

One is a TabHost which hosts different tabs where one is a QR Scanner Tab. If I click the Button the it starts the scanning App and Scans it and returns it to the activity and shows the result (I start it with StartActivityForResult()…).
The other Layout is a ListView where you can select between the functions. If you select QR Scanner there it opens up the Activity. If you click Scan QR Code there it starts ZXing again but if something has been scanned it falls back to the Listview Layout.

This is how my activities are declared in the manifest (ListView Layout):

<activity
        android:name=".ListActivities"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:label="@string/app_name" >
</activity>

And the TabHost:

<activity
        android:name=".TabHoster"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:label="@string/app_name" >
</activity>

And this is the Manifest entry of the ScanQR class:

<activity
        android:name=".QRScanner"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:label="@string/app_name"
        android:launchMode="singleInstance" />

Here is the code from ListActivities -> ScanQR:

Intent intent = new Intent(this, ScanQR.class);
startActivity(intent);

And this is the code to launch the ZXing library:

Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivityForResult(intent, 0);

And the Code for the result returned from it:

if (resultCode == RESULT_OK) {
       String contents = intent.getStringExtra("SCAN_RESULT");

       txtPleaseScan.setVisibility(View.GONE);

       ScrollView qrLayout = (ScrollView) findViewById(R.id.qrLayout);
       qrLayout.setVisibility(View.VISIBLE);

       txtQRResult.setText(contents);
  } else if (resultCode == RESULT_CANCELED) {
  }

btw I’m using the same ScanQR code for both layouts…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:32:18+00:00Added an answer on June 9, 2026 at 1:32 pm

    Wow ok I was able to fix it myself… The problem was in the AndroidManifest.xml…
    The android:launchMode and the android:configChanges were wrong there I guess… After removing it, it works fine in both layouts…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different layouts in my app, one for javascript (AJAX) requests and
So I have different layouts for this one Activity. And I have different classes
I have a tabhost with 4 tabs. Each tab has several editboxes. On real
I have created a tab based app, in one of the tab, there is
I'm working on an android app which has different layouts for phone vs tablet.
Suppose I have 3 completely different layouts for one site. The first is shown
I want to have different layouts like [left|content|right] and [left|content] or [content|right] when using
I have two Android applications with a similar functionality but different drawables and layouts.
I have an alternate homepage template, homepage.pt, which has a different layout. When I
I have different php output in jQuery-based tabs. This output is formed from database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.