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

  • Home
  • SEARCH
  • 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 8081575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:46:26+00:00 2026-06-05T16:46:26+00:00

So if a logout button is clicked on the webview (which is a spring

  • 0

So if a logout button is clicked on the webview (which is a spring app), the page should get back to the android login page. is this possible? the code is on a .js file. i want it like

        if(btnlogout.clicked) then 
            go to Intent intent = new Intent(menuScreenActivity.this,
                        LoginActivity.class);
  • 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-05T16:46:28+00:00Added an answer on June 5, 2026 at 4:46 pm

    Hmmm maybe yo need to integrate your webview and your java code as you can see here:

    http://developer.android.com/guide/webapps/webview.html

    Binding JavaScript code to Android code

    WebView myWebView = (WebView) findViewById(R.id.webview); 
    WebSettings webSettings = myWebView.getSettings(); 
    webSettings.setJavaScriptEnabled(true);
    webView.addJavascriptInterface(new JavaScriptInterface(this), "Android");
    

    So, you are Telling here that your webview can use run javascript and will be able to access to your java code available at JavaScriptInterface class and its public methods on using js like this way:

    <input type="button" value="Say hello" onClick="showAndroidToast('Hello Android!')" />
    
    <script type="text/javascript">
        function showAndroidToast(toast) {
            Android.showToast(toast);
        }
    </script>
    

    The line on javascript is Android.showToast(toast); and Android is the name you choosed here webView.addJavascriptInterface(new JavaScriptInterface(this), “Android”);

    showToast is a public method on JavaScriptInterface CLASS containing what ever you need, in this case:

    **public void showToast(String toast) {
        Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
    }**
    

    just copied all this from that link… i think this answer your question, you can create your method called Logout that do the necesary stuff like:

    Intent intent = new Intent(menuScreenActivity.this,LoginActivity.class);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When you click login, it should then display the logout button. Clicking the logout
Whenever the user clicks logout button he is redirected to login page then he
My iphone app have login screen, and logout button in the app, requierment was
I have a button like this: <Button android:id=@+id/logout_button android:layout_width=fill_parent android:layout_height=wrap_content android:text=Log out /> and
In our login/logout javascript, which works in a modal box, I'd like to reload
I have created a user page with a menu that contains a logout button.
I have asp.net web site in which user can login and also do logout
In my website when the user clicks on the Logout button, the Logout.aspx page
HI I have got Facebook Connect working with a functional login and logout button.
HI I have got Facebook Connect working with a functional login and logout button.

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.