Mam zrobione pole textview i buttona. Chciałem żeby po wciśnięciu przycisku tekst się zmieniał. Co robię źle?
public class MainActivity extends ActionBarActivity {
Button p1;
TextView t1;
public void obsluga_przycisku(View v)
{
t1.setText("dziala");
//Toast.makeText(getApplicationContext(), "dziala", 10).show();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
p1=(Button) findViewById(R.id.przycisk1);
t1=(TextView) findViewById(R.id.poletekstowe);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
}