Я получаю этот код ошибки The constructor TextView(new View.OnClickListener(){}) is undefined
, пожалуйста, помогите мне, это мой код, его уже несколько дней беспокоили.
`package com.example.tgtidea;Конструктор TextView (новый View.OnClickListener() {}) не определен
public class FrontPage extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_front_page);
Button btn1 = (Button)findViewById(R.id.button1);
btn1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
EditText comment = (EditText)findViewById(R.id.editText1);
String comment1 = comment.getText().toString();
TextView textView = new TextView();
textView.setTextSize(40);
textView.setText(comment1);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.front_page, menu);
return true;
}
}
`
Это не весь мой код, но это большая его часть. сделал некоторые исследования, и похоже, что у некоторых других людей была аналогичная проблема, кроме как с Intent вместо Text View. Я довольно молодой программист, мне только 14, так извините мое невежество. Спасибо за помощь.