I’ve fingers on my teeths with Java and Android. Normaly i code with Python, it easier and easier !
Java never let me do anything, or only in a unique method that i never know 🙁
So the only code working is copy-paste and it’s hard to customize…
So, i’ve a simple editable text and a button, when i click on it, i go to an url. The button works : i can open my webview.
But i want to make the url with the editText and i can’t 🙁
See that :
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Add Click listeners for all buttons
final EditText Login = (EditText) findViewById(R.id.entry);
View firstButton = findViewById(R.id.ok);
firstButton.setOnClickListener(this);
}
public void onClick(View v) {
switch(v.getId()){
case R.id.ok:
Intent j = new Intent(this, Webscreen.class);
j.putExtra(com.tatai.froyo.Webscreen.URL,
"http://192.168.1.12/index2.php");
startActivity(j);
break;
}
So, how can i have the login edittext to make the url like http://192.168.1.12/index2.php?log=toto
… where toto may is get with the login edittext.
Impossible to read a global var on the onclick, i’m lost ! 🙁
i trid that on the onclick listner :
String logDetail = Login.getText().toString();
but it can’t see Login, it’s out ! : undeclared
on your code, TRy this,
EDIT: