There are 2 View elements and 2 Button elements. I want that by clicking on one Button text changes only in one View , and not in two, as is happening now.
I do not know how to divide it all in the code.
public class MainActivity extends ActionBarActivity { private TextView mTextView; private TextView m2TextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTextView = (TextView) findViewById(R.id.textView); m2TextView = (TextView) findViewById(R.id.textView2); } public void onClick(View view) { mTextView.setText("privet ot 1 view"); m2TextView.setText("Privet ot 2 view"); } }