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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:10:13+00:00 2026-06-05T15:10:13+00:00

The above image is just adding two values and displaying the result on the

  • 0

Emulator's image

The above image is just adding two values and displaying the result on the below textview.
But i need to show that answer on the first tab(ie.Tab_1) of tabhost on next screen.
How to do this?

.java class

 public class Demo_webserviceActivity extends Activity
{
/** Called when the activity is first created. */

   private static String NAMESPACE = "http://tempuri.org/";
   private static String METHOD_NAME = "FahrenheitToCelsius";
   private static String SOAP_ACTION = "http://tempuri.org/FahrenheitToCelsius";
   private static String URL = "http://www.w3schools.com/webservices/tempconvert.asmx?WSDL";

   Button btnFar;
   EditText txtFar;

   @Override
   public void onCreate(Bundle savedInstanceState)
   {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.main);

   btnFar = (Button)findViewById(R.id.btnFar);

   txtFar = (EditText)findViewById(R.id.txtFar);

   btnFar.setOnClickListener(new View.OnClickListener()
   {
   public void onClick(View v)
   {

       String b;

     //Initialize soap request + add parameters
     SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);       

     //Use this to add parameters
     request.addProperty("Fahrenheit",txtFar.getText().toString());

     //Declare the version of the SOAP request
     SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

     envelope.setOutputSoapObject(request);
     envelope.dotNet = true;

     try 
     {
         HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

         //this is the actual part that will call the webservice
         androidHttpTransport.call(SOAP_ACTION, envelope);

         // Get the SoapResult from the envelope body.

         SoapPrimitive result = (SoapPrimitive)envelope.getResponse();

         if(result != null)
         {
          //Get the first property and change the label text

            b = result.toString();

            Intent i = new Intent(getApplicationContext(),Activity2.class);
            i.putExtra("gotonextpage", b.toString());
            startActivity(i);
          }

         else
         {
           Toast.makeText(getApplicationContext(), "No Response",Toast.LENGTH_SHORT).show();
         }
    }
    catch (Exception e)
    {
       e.printStackTrace();
       }
     }
   });
   }
} 

NOTE : This source is actually consuming a webservice from android and showing the result by SOAP method

Thanks a lot.

  • 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-05T15:10:15+00:00Added an answer on June 5, 2026 at 3:10 pm

    You can use Shared preferences to store values, then you can access it in any activity of your project:

    follow this link

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

Sidebar

Related Questions

I want to do exactly like the above image via code (android). But I'm
header(Content-type: image/gif); readfile($filename); The above can only be used to show gif images. Is
In the image above is the sample list of Serial# and Part# that I've
In my application I need show some info popup. This is just a text
in my header I've got a large image. Above that image I want to
http://i44.tinypic.com/b69h1h.jpg Take a look at the above image, especially the Firebug window. Now have
I have an image above a div, and IE (7, and presumably 6) insists
Image describing the problem http://img215.imageshack.us/img215/3725/20100314235127schedule2.jpg I hope the image above can explain what I
Please check out http://rainsongmanchesters.net/news.htm and notice the black strip above the header image. Now
Any idea why my image does not horizontally line up with the text above

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.