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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:56:22+00:00 2026-05-15T05:56:22+00:00

I have the following code in a form’s submit button onClickListener: String action, user,

  • 0

I have the following code in a form’s submit button onClickListener:

String action, user, pwd, user_field, pwd_field;

        action = "theURL";

        user_field = "id";
        pwd_field = "pw";
        user = "username";
        pwd = "password!!";

        List<NameValuePair> myList = new ArrayList<NameValuePair>();
        myList.add(new BasicNameValuePair(user_field, user)); 
        myList.add(new BasicNameValuePair(pwd_field, pwd));

        HttpParams params = new BasicHttpParams();
        HttpClient client = new DefaultHttpClient(params);
        HttpPost post = new HttpPost(action);
        HttpResponse end = null;
        String endResult = null;

        try {
            post.setEntity(new UrlEncodedFormEntity(myList));
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 

        try {
            HttpResponse response = client.execute(post);
            end = response;
        } catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }  


        BasicResponseHandler myHandler = new BasicResponseHandler();

        try {
            endResult = myHandler.handleResponse(end);
        } catch (HttpResponseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

How can I take the resulting string (endResult) and start a new activity using an intent that will open webview and load the html?

  • 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-15T05:56:23+00:00Added an answer on May 15, 2026 at 5:56 am

    You can start a new intent with

    Intent myWebViewIntent = new Intent(context, MyWebViewActivity.class);
    myWebViewIntent.putExtra('htmlString', endResult);
    context.startActivity(myWebViewIntent);
    

    Then in your MyWebViewActivity class you would have something like:

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
        setContentView(R.layout.my_view_that_contains_a_webview);
        WebView webview = (WebView)findViewById(R.id.my_webview);
    
        Bundle extras = getIntent().getExtras();
        if(extras != null) {
    
             // Get endResult
             String htmlString = extras.getString('htmlString', '');
             webview.loadData(htmlString, "text/html", "utf-8");
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: echo ' <td> <input type=button name=delete value=X onclick=clearSelection(this.form, '.$type.');this.form.submit();
I have the following code alert(Submit the form); document.form[0].action = contact_form3.asp?proc=true; alert(action changed?); document.form[0].submit();
I have the following code: // Form the continuities list string[] continuities = new
I have the following code: index.jsp: <form name=f action=db/ajoutConducteur.jsp method=post> <input type=text pattern=\d{8} required
I have the following code: <div id=header> <h1>HEADER TEXT</h1> <div id=members> <form action= method=post>
I have following html form: <form method=post action=> <input type=hidden name=userid id=user value=<?php echo
Hi I have the following code in a form . When the user clicks
I have following code: <asp:Button ID=InsertButton runat=server CausesValidation=True CommandName=Insert Text=Add Form PostBackUrl=~/APPLICATION/FormView.aspx?postquestion=/> I using
I have the following code: <form action=search.php method=get name=searchprod id=prodsearch> <table border=0 cellpadding=0 cellspacing=0>
I have the following form code: # forms.py class SomeForm(forms.Form): hello = forms.CharField(max_length=40) world

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.