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 7998437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:12:42+00:00 2026-06-04T15:12:42+00:00

I have an android app that starts with a simple screen and a start

  • 0

I have an android app that starts with a simple screen and a “start” a button. Once the user clicks the button it retrieves code from a url and puts it into a list. If you press back from the listview it will show a blank screen not a screen with the “start” button. All the code is in a onCreate statement. Please excuse me if I am missing the obvious this is my first real android app (aside from the Hello Android tutorial). Below is the code in the first activity if that helps.

public class Main extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Button next = (Button) findViewById(R.id.butQR);
    next.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            setContentView(R.layout.listplaceholder);
            Intent myIntent = new Intent(view.getContext(), NewListActivity.class);
            myIntent.putExtra("race_id", view.getId());
            myIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
            myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(myIntent);
        }

    });
}

Update: I wa using setContentView(R.layout.listplaceholder); on button click and in the new oncreate for the next activity. Thanks for the help.

  • 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-04T15:12:43+00:00Added an answer on June 4, 2026 at 3:12 pm

    From what you have mentioned it doesn’t seem like you need the intent flags.
    When you set the FLAG_ACTIVITY_CLEAR_TOP flag, if the activity to be launched is already running, all other activities on top of it are closed such that the activity being called (which was already running and in the stack) is now on top. Now, when you press the back button, it should go to the activity that was running before this, but since your Main activity was closed because of that flag, you get a blank screen.

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

Sidebar

Related Questions

I have a dialog in an Android app that I don't want the user
Lets say you have a web app related Android app that requires the user
I have a simple Android app that pulls all music files on the phone
I have created a simple app for android, that uses buttons to navigate different
I have a Android application that requires a splash screen. I have a simple
I have an Android app that I had working a few months ago which
I have an Android app that begins by displaying a dialog. When I set
I started developing an android app that have to interact with MMS attachements, in
I have a custom view in my Android App that uses a ScaleGestureDetector.SimpleOnScaleGestureListener to
i have an app that runs perfectly on android 1.6+, but admob ads are

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.