1. AC Question's Avatar
    Please some one help me to understand I am building a simple WebView app and have override method OnBackPressed() to just make the functionality to go back if some one touches back button. Unfortunately my app closes with error "App has stopped working" meanwhile android studio also shows some run-time errors. My code is as below : -

    @Override
    public void onBackPressed()
    {
    if (view.canGoBack())
    {
    view.goBack();
    } else

    {
    //otherwise exit my app
    super.onBackPressed();
    }
    }

    I dont know what is wrong please some one clear my point.
    01-05-2017 11:34 AM
  2. Javier P's Avatar
    Mod note. Thread moved to the Developers Lounge forum for more visibility.
    belodion likes this.
    01-05-2017 12:35 PM
  3. Justify23's Avatar
    to go back to where? if you're referring to another activity you should initiate an intent and call the activity you wanted to go back. the code you provided doesn't provide much as you didn't include what view you are referring to.
    02-06-2017 01:59 AM

Similar Threads

  1. Replies: 1
    Last Post: 01-05-2017, 12:47 PM
  2. A5 keeping dropping my router
    By AC Question in forum Ask a Question
    Replies: 0
    Last Post: 01-05-2017, 11:32 AM
  3. Why is an iPhone user not getting my texts?
    By AC Question in forum Ask a Question
    Replies: 0
    Last Post: 01-05-2017, 11:27 AM
  4. Replies: 0
    Last Post: 01-05-2017, 11:24 AM
  5. Why is an iPhone user not getting my texts?
    By AC Question in forum Ask a Question
    Replies: 0
    Last Post: 01-05-2017, 11:22 AM
LINK TO POST COPIED TO CLIPBOARD