Click here to Skip to main content
15,915,509 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
EditText username = (EditText)LoginActivity().findViewById(R.id.txtuser);

showing this error Method Call Expected on android studio.

What I have tried:

Showing Method Call expected on
LoginActivity()
What should I do to get rid out of this, actually I want to pass the EditText parameter to WCF sercvices, Thats why I am using this line, Is it correct?
Posted
Updated 21-Aug-17 17:51pm
Comments
Richard MacCutchan 21-Aug-17 4:22am    
What is LoginActivity?
Member 13233111 21-Aug-17 10:14am    
Current page... i.e.LoginActivity.java
Richard MacCutchan 21-Aug-17 10:29am    
Do you actually understand the difference between a source file and an object or method in the program?

1 solution

Quote:
actually I want to pass the EditText parameter to WCF sercvices,

This is the way how you pass the editText value.

First, initialize your editText
EditText username = (EditText)findViewById(R.id.txtuser);

After that, get the username value
String name = username.getText().toString();

Then only pass the name to WCF sercvices
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900