I am a super newbie to Android studio and Java programming. I wrote a super simple code just wanted to test it out on android studio, but the system wont run it and it shows cannot resolve symbol
, I have already invalidated and restarted it, but it still shows me that.
MainActivity.java:
package com.example.abc22.acsystem;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
EditText sname, fname, phone;
TextView txv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
sname = (EditText) findViewById(R.id.firstname);
fname = (EditText) findViewById(R.id.lastname);
phone = (EditText) findViewById(R.id.phone);
txv = (TextView) findViewById(R.id.txv);
}
public void onclick(View v){
txv.setText (sname.getText().toString()+fname.getText()+"number is" + phone.getText());
}
}