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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:08:09+00:00 2026-06-04T10:08:09+00:00

I have a problem with back button. He doesn’t work. When I go from

  • 0

I have a problem with back button. He doesn’t work. When I go from first activity to second and from second to third back button don’t want work. I used :

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
        moveTaskToBack(true);
        Log.v("Co1s", "Cos1");
        return true;
    }
    return super.onKeyDown(keyCode, event);
}

But when I push the button I get only:

05-23 10:45:57.863: W/KeyCharacterMap(238): Can’t open keycharmap file
05-23 10:45:57.863: W/KeyCharacterMap(238): Error loading keycharmap
file ‘/system/usr/keychars/pm8058-keypad.kcm.bin’.
hw.keyboards.0.devname=’pm8058-keypad’ 05-23 10:45:57.863:
W/KeyCharacterMap(238): Using default keymap:
/system/usr/keychars/qwerty.kcm.bin

And this log in this function is not showing in logs. Why?

Edit:
acrivity nr1:

protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.services_description);

        back_button = (Button) findViewById(R.id.service_back_button);
        back_button.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                intent = new Intent(services_description.this, service.class);
                TabActivityGroup parentActivity = (TabActivityGroup)getParent();
                parentActivity.startChildActivity("menu_activity", intent);     
                finish();
            }
        });
    }
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            Log.v("Co1s", "Cos1");
        }
        return super.onKeyDown(keyCode, event);
    }

and second:

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.service);

    title = (TextView) findViewById(R.id.serviceTitle);
    description = (TextView) findViewById(R.id.serviceDescription);
    nextPage = (ImageView) findViewById(R.id.serviceNextPage);
    back_button = (Button) findViewById(R.id.service_back_button);


    nextPage.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            intent = new Intent(service.this, services_description.class);
            TabActivityGroup parentActivity = (TabActivityGroup)getParent();
            parentActivity.startChildActivity("menu_activity", intent);     

        }
    });
    back_button.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {

            finish();

        }
    });
}
@Override
public void onBackPressed() {
    Log.v("Cos", "Cos");
    finish();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
        moveTaskToBack(true);
        Log.v("Co1s", "Cos1");
        return true;
    }
    return super.onKeyDown(keyCode, event);
}
  • 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-04T10:08:10+00:00Added an answer on June 4, 2026 at 10:08 am

    You shouldn’t have to do anything to get the back button working. Just remove the whole block if (keyCode == KeyEvent.KEYCODE_BACK) etc, and you should be all good.

    If you for some reason need to log when the back button is clicked, I think you could do it like this:

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            Log.v("Co1s", "Cos1");
        }
        return super.onKeyDown(keyCode, event);
    }
    

    The important thing is that you pass on the “handling” of the click on the button to the overridden method and let the Android OS itself handle going back to the previous activity.

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

Sidebar

Related Questions

I have a problem returning data back to the function I want it returned
I have a new problem with a Form and the BACK button. Take this
I have a problem that appears and disappears for mysterious reasons. A while back
I have a problem. I have a view that is getting back no results
I have been spending some time on this. My problem involves bringing back domain
OSX 10.7, XCode 4. I have a small problem: I need to push back
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have problem with fancybox. I want to write a function that will run
I have a problem where I can successfully push a new view controller from
I have an issue with the browser [BACK] button. Let me explain. There is

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.