i m trying to parse the data from a link with gets information about city and state from an edit text i want to get the data of edit text save it in a string and then use that string in another class. i tried my best by creating an object an calling the function but it don’t work please someone help me
this is the code for getting the text and returing that string to a function.
public String et(){
location= et.getText().toString();
return this.location;
}
and this is the other class where i am using this edittext by saving it in a string
public void test(){
Main mm= new Main();
location1= mm.et();
}
but it don’t work where i am going wrong i don’t know.i know its silly question but please help me .
Make location as a
static Stringand access it in other class usingClass_Name.location;//Now consider method et was called and location variable have been initialized to some String