Ao tentar abrir a lista de provas, da um erro dizendo que não reconhece o frame_principal e o secundario
Erro
02-26 18:40:42.009 7700-7700/com.example.luisborges.agenda E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.luisborges.agenda, PID: 7700
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.luisborges.agenda/com.example.luisborges.agenda.ProvaActivity}: java.lang.IllegalArgumentException: No view found for id 0x7f070041 (com.example.luisborges.agenda:id/frame_principal) for fragment ListaProvasFragment{c28d1e6 #0 id=0x7f070041}
at
ListaProvaFragment
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragement_prova, container, false);
List<String> topicosPort = Arrays.asList("Sujeito", "Objeto direto", "Objeto indireto");
Prova provaPortugues = new Prova("Portugues", "25/05/2016", topicosPort);
List<String> topicosMat = Arrays.asList("Equacoes de segundo grau", "Trigonometria");
Prova provaMatematica = new Prova("Matematica", "27/05/2016", topicosMat);
List<Prova> provas = Arrays.asList(provaPortugues, provaMatematica);
ArrayAdapter<Prova> adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, provas);
ListView lista = (ListView) view.findViewById(R.id.provas_lista);
lista.setAdapter(adapter);
lista.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Prova prova = (Prova) parent.getItemAtPosition(position);
Toast.makeText(getContext(), "Clicou na prova de " + prova, Toast.LENGTH_SHORT).show();
}
});
return view;
}
DetalhesProvaFragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_detalhes, container, false);
return view;
}
Activity Prova (Land)
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout
android:id="@+id/fragment_principal"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent">
</FrameLayout>
<FrameLayout
android:id="@+id/frame_secundario"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
></FrameLayout>
</LinearLayout>