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

The Archive Base Latest Questions

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

I am using HTTPPost to send values to a server. The script works fine

  • 0

I am using HTTPPost to send values to a server. The script works fine with what I have below. However if I change the name value pair to this I get a force close:

nameValuePairs.add(new BasicNameValuePair("id", idOfTextView.getText().toString()));

This is the code without it reading the textview:

 String url_select = "http://mydomain.com/get.php";
    HttpClient httpClient = new DefaultHttpClient();
    HttpPost httpPost = new HttpPost(url_select);
    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
    nameValuePairs.add(new BasicNameValuePair("id", "1"));
    try {
        httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        HttpResponse httpResponse = httpClient.execute(httpPost);
        HttpEntity httpEntity = httpResponse.getEntity();
        //read content
        is =  httpEntity.getContent();                  
    } catch (Exception e) {
        Log.e("log_tag", "Error in http connection "+e.toString());
    }

    try {
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
        StringBuilder sb = new StringBuilder();
        String line = "";
        while((line=br.readLine())!=null){
            sb.append(line+"\n");
        }
        is.close();
        result=sb.toString();               
    } catch (Exception e) {
        Log.e("log_tag", "Error converting result "+e.toString());
    }
    return null;
  • 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:29:58+00:00Added an answer on June 5, 2026 at 4:29 pm

    Looks like my comment was the answer, make sure idOfTextView is non-null.

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

Sidebar

Related Questions

I am trying to send data to my server using HttpPost via the following
I'm trying to send a URL with some parameters using HttpPost but it has
I want to send a couple of values to a web server from my
I want to send a couple of values to a web server from my
I have a bound list using knockoutjs / mvc3 <div data-bind=foreach: phones> <input data-bind='value:
when using http post with flash that send ip address request from client computer
I got problem with sending data in Android using httpPost. I found some example,
Using an MVC3 .net controller on the back-end, I am performing an HttpPost to
I'm trying to download strings from a HttpPost and I'm using the Async class
I have a document library site and would like to send an email when

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.