问题
I have just started trying out Android Studio, following the instructions on a video tutorial.
Here is my take on what the guy tells me but I keep getting the error message View is deprecated.
How do I fix this? Or what do I use instead?
Here is my code:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button sendButton0001 = (Button) findViewById(R.id.buttonSend0001);
EditText welcomeText = (EditText) findViewById(R.id.editTextWelcome);
sendButton0001.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
}
回答1:
This is just a warning. I don't know why it shows up, but if it runs fine - don't take care.
来源:https://stackoverflow.com/questions/50008555/android-view-view-is-deprecated-what-else-to-use-or-how-to-fix