package com.example.agenda2;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class MainActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
List<String> alunos = new ArrayList<>(
Arrays.asList("Alex","Fran","Jose","Maria","Ana"));
ListView listaDeAlunos = findViewById(R.id.activity_main_lista_de_alunos);
listaDeAlunos.setAdapter(new ArrayAdapter<>
(this,
android.R.layout.simple_list_item_1,
alunos));
}
}
Esse é o meu MainActivity e quando vou no editor para inserir arrastando dá esse erro:
'clickable' attribute found, please also add 'focusable' A widget that is declared to be clickable but not declared to be focusable is not accessible via the keyboard. Please add the focusable attribute as well. Issue id: KeyboardInaccessibleWidget