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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:10:29+00:00 2026-06-17T19:10:29+00:00

Is it possible to erase a specific url from the android’s webview history? I

  • 0

Is it possible to erase a specific url from the android’s webview history? I Google a lot but was not able to find any sol, even i checked the api’s documentation and i think there is no direct way to do the same.
have a look at below code:

// getting the whole list of web view's history....
WebBackForwardList list = wv.copyBackForwardList();
// getting previuous item/link 
String lastUrl = list.getItemAtIndex(list.getCurrentIndex()-1).getUrl();

From 2nd line of code it is clear that it is possible to play around with history, so i think there must be some way or trick to delete a particular link from web view history.
Does it makes any sense to you guys?

Any code snippet or any link will highly be appreciated.

thanks,

  • 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-17T19:10:31+00:00Added an answer on June 17, 2026 at 7:10 pm

    Well, not sure if you actually can play around with the back forward list. I would assume it’s a copy – at least that’s what the name suggest.

    However, you can manipulate the back stepping to some degree. In my case I exit the application already when user tries to step back from second page towards first page.

      @Override
      public boolean dispatchKeyEvent(KeyEvent event) {
        int action = event.getAction();
        int keyCode = event.getKeyCode();
        switch (keyCode) {
            case KeyEvent.KEYCODE_BACK:
                if ((action == KeyEvent.ACTION_DOWN) && myWebView.canGoBack() ) {
                    WebBackForwardList list = myWebView.copyBackForwardList();
                    String lastUrl = list.getItemAtIndex(list.getCurrentIndex()-1).getUrl().toString();
    
                    // Exit if index == 1, i.e. currently on 2nd page
                    if (list.getCurrentIndex() == 1) {
                        finish();
                    } else ...
    

    You could step over also other other pages by combining stuff from above and overloading url loading:

                @Override
                public boolean shouldOverrideUrlLoading(WebView  view, String  url){
                     view.loadUrl(url);
                     return true;
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to filter items from a std::map? std::list::erase not working I have
Possible Duplicate: how to start counting from 1 after erase table in access ?
Is it possible to access the std::for_each iterator, so I can erase the current
Possible Duplicate: iterator validity ,after erase() call in std::set When I iterate over a
how would I create a link that would when clicked erase a record from
is it possible to return a reference from a function like in this example
Possible Duplicate: Difference between erase and remove suppose i have a container.... what does
This is a very specific question, but a good answer might also give me
In order to be able to substitute a specific implementation, it is commonly known
Is it possible to erase user-defined function? My CMS has one function, which I

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.