简体   繁体   中英

Content of Edittext not getting changed

I am using an Edtitext in my code and its declaration inside main is as follows:

<EditText 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/url" 
    android:text="http://192.168.1.42:8080/NotifyServlet/serv"
    />

as i want one default value for my edittext. but even after i am changing the value of it at run time and passing it as a parameter to another service its original value which i set in main.xml is getting passed. Can anyone please suggest how should i handle it. Thanks!!

I can only assume you execute

String url_server = url.getText().toString();

before actual value is set. This should be run in onClickListener()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM