Reputation: 51
i make first steps with android. but i get this error: identifier expeted at "puplic void try(View view)
". where is the error?
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
puplic void try(View view)
{
String wert;
EditText F1 = (EditText)findViewById(R.id.b1);
wert = F1.getText().toString();
}
}
Upvotes: 0
Views: 1833
Reputation: 66657
try is reserved word in java, use something else
public void try2(View view)
Upvotes: 2