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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:26:24+00:00 2026-05-26T11:26:24+00:00

I had read about this thread around the Internet but unlucky to find a

  • 0

I had read about this thread around the Internet but unlucky to find a solution. The solutions that are available did not work for me like adding the android:noHistory="true" in the Manifest file. What I wanted is that after the user clicks the play game button, which will redirect the user into the select difficulty page, when the user clicks the back button (android emulator), it will go back to the main menu.

This is my manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.kfc"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".NewKFCActivity"
              android:label="@string/app_name"
              android:noHistory="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".HelpPageOne"
              android:label="@string/app_name"
              android:noHistory="true">
        <intent-filter>
            <action android:name="com.kfc.HELPPAGEONE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

    <activity android:name=".HelpPageTwo"
              android:label="@string/app_name"
              android:noHistory="true">
        <intent-filter>
            <action android:name="com.kfc.HELPPAGETWO" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

    <activity android:name=".SelectDifficulty"
              android:label="@string/app_name"
              android:noHistory="true">
        <intent-filter>
            <action android:name="com.kfc.SELECTDIFFICULTY" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

</application>

This is my main activity:

package com.kfc;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;

public class NewKFCActivity extends Activity {
    /** Called when the activity is first created. */
    ImageButton bPlay, bHelp;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);
        bPlay = (ImageButton) findViewById(R.id.playGame);
        bPlay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent intent = new Intent(v.getContext(), SelectDifficulty.class);
                startActivityForResult(intent,0);
                finish();
            }
        });

        bHelp = (ImageButton) findViewById(R.id.Help);
        bHelp.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent intent = new Intent(v.getContext(), HelpPageOne.class);
                startActivityForResult(intent,0);
                finish();
            }
        });


    }
    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
        finish();
    }
}

This is my difficulty class:

package com.kfc;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;

public class SelectDifficulty extends Activity{
    ImageButton bEasy, bMedium, bHard;
    @Override
    protected void onCreate(Bundle kfcState) {
        // TODO Auto-generated method stub
        super.onCreate(kfcState);
        setContentView(R.layout.difficultyxml);

        bEasy = (ImageButton) findViewById(R.id.easy);
        bEasy.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                //Intent intent = new Intent(v.getContext(), NewKFCActivity.class);
                //startActivityForResult(intent,0);
            }
        });
    }

}
  • 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-05-26T11:26:25+00:00Added an answer on May 26, 2026 at 11:26 am

    First of all, you should know the difference between startActivity() and startActivityForResult(), see Android developers website.

    Second, I think you should need to understand the lifecycle of an Activity, you don’t need to finish() every activity once you leave it, Android will manage that for you.

    Hope it helps 🙂
    Cheers!

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

Sidebar

Related Questions

I had read somewhere about one specific feature that is present in awk but
Had a good read through similar topics but I can't quite a) find one
I read a lot about versioning REST APIs, f.e. in this thread: Best practices
I read about Big-O Notation from here and had few questions on calculating the
I was fairly sure that I had read (in Richter's C# book) that objects
I recently read in a presentation on Scribd that Facebook had benchmarked a variety
I've read somewhere that the trunk version of Firefox already had a WebSocket implementation.
Just have read sass changelog and found out that FSSM (the gem that had
I read this about class in the C++ standard document: A class is a
I've read many posts about this, the last being a statement saying the behaviour

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.