I want to get information about how to read data from textView

China☆狼群 提交于 2019-12-12 03:39:05

问题


i am building an android app in this I want to get information how to read data from textView and to send an http request i was not able to figure out what is to be done to make it work.

Following is the code that i have used in intent section which will get the data from Edit text .

Intent summeryPage = new Intent(Form_section.this ,summry_page.class);
                    // ((routernBoltBeam)this.getApplication()).setFirstName(FirstName);
                    summeryPage.putExtra("fname",fName.getText().toString());
                    summeryPage.putExtra("lname",lName.getText().toString());
                    summeryPage.putExtra("date",date.getText().toString());
                    summeryPage.putExtra("email",emailAddress.getText().toString());
                    summeryPage.putExtra("mobuleNumber",mobileNumner.getText().toString());
                    summeryPage.putExtra("adults",adultsNumber.getText().toString());
                    summeryPage.putExtra("totalChildren",childensNumber.getText().toString());
                    summeryPage.putExtra("childAge",childrensage.getText().toString());
                    summeryPage.putExtra("hotelRooms",numberOfhotelRooms.getText().toString());
                    summeryPage.putExtra("departureCity",departureCity.getText().toString());
                    summeryPage.putExtra("destination",yourDesiredDestination.getText().toString());
                    summeryPage.putExtra("days",numberOfDays.getText().toString());
                    summeryPage.putExtra("Budget",yourBudget.getText().toString());
                    summeryPage.putExtra("selectHotel",preferHotel);
                    summeryPage.putExtra("airtickets",airticketPrefer);
                    summeryPage.putExtra("intercity",vehiclePreferance);
                    summeryPage.putExtra("travelType",travelPreferances);
                    summeryPage.putExtra("mealPlan",mealPreferances);
                    summeryPage.putExtra("addInfo",additionalInformation.getText().toString());

                    startActivity(summeryPage); 

Following is the code which will set the data into the respective textView on other activity

public void showData(){
        nameText =(TextView)findViewById(R.id.content);
        viewDateText =(TextView)findViewById(R.id.showDate);
        viewEmailText=(TextView)findViewById(R.id.showEmail);
        viewMobileText=(TextView)findViewById(R.id.showMobileNumber);
        viewTotalAdultText = (TextView)findViewById(R.id.showTotalAdults);
        ViewTotalChildren =(TextView)findViewById(R.id.showTotalChildrens);
        viewChildAge =(TextView)findViewById(R.id.showChildrensAge);
        viewTotalRoomsText =(TextView)findViewById(R.id.showTotalRooms);
        viewDepartureText =(TextView)findViewById(R.id.showDepartureCity);
        viewDeatinationText =(TextView)findViewById(R.id.showDestination);
        viewDaysText =(TextView)findViewById(R.id.showTotalDays);
        viewBudgetText =(TextView)findViewById(R.id.showBudget);
        viewPreferHotelText =(TextView)findViewById(R.id.showHotelPreferance);
        viewAirticketText =(TextView)findViewById(R.id.showAirticketRequired);
        viewIntercityText = (TextView)findViewById(R.id.showIntercityTravel);
        viewTravelTypeText = (TextView)findViewById(R.id.showTraveType);
        viewMealText =(TextView)findViewById(R.id.showMealPlan);
        viewInfoText = (TextView)findViewById(R.id.showAdditionalInfo);
        //String s =((routernBoltBeam)this.getApplication()).getFirstName();


        Intent summery = getIntent();
        String fName = summery.getStringExtra("fname");
        String lName = summery.getStringExtra("lname");
        String Date = summery.getStringExtra("date");
        String Email = summery.getStringExtra("email");
        String Mobile = summery.getStringExtra("mobuleNumber");
        String totalAdults = summery.getStringExtra("adults");
        String totalChildrens = summery.getStringExtra("totalChildren");
        String ChildresnAge = summery.getStringExtra("childAge");
        String TotalRooms = summery.getStringExtra("hotelRooms");
        String Departure = summery.getStringExtra("departureCity");
        String Destination = summery.getStringExtra("destination");
        String TotalDays = summery.getStringExtra("days");
        String TotalBudget = summery.getStringExtra("Budget");
        String PreferHotel = summery.getStringExtra("selectHotel");
        String SelectAirticket = summery.getStringExtra("airtickets");
        String InterCityText = summery.getStringExtra("intercity");
        String travelType= summery.getStringExtra("travelType");
        String MealPlan = summery.getStringExtra("mealPlan");
        String AddInfo = summery.getStringExtra("addInfo");



        nameText.setText(fName +" "+lName);
        viewDateText.setText(Date);
        viewEmailText.setText(Email);
        viewMobileText.setText(Mobile);
        viewTotalAdultText.setText(totalAdults);
        ViewTotalChildren.setText(totalChildrens);
        viewChildAge.setText(ChildresnAge);
        viewTotalRoomsText.setText(TotalRooms);
        viewDepartureText.setText(Departure);
        viewDeatinationText.setText(Destination);
        viewDaysText.setText(TotalDays);
        viewBudgetText.setText(TotalBudget);
        viewPreferHotelText.setText(PreferHotel);
        viewAirticketText.setText(SelectAirticket);
        viewIntercityText.setText(InterCityText);
        viewTravelTypeText.setText(travelType);
        viewMealText.setText(MealPlan);
        viewInfoText.setText(AddInfo);

    }

so now what i want do is to read the data from these TEXTVIEWS and to send an HTTP REQUEST to an link and i am not able to understand how to figure it out

来源:https://stackoverflow.com/questions/38252826/i-want-to-get-information-about-how-to-read-data-from-textview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!