Activity does not return view

0

I'm trying to compile but it's not giving, my layoute looks like this:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:background="#F9F9F9" >

<include
    android:id="@+id/toolbar_actionbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    layout="@layout/toolbar_default" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="DRAGÃO"
    android:id="@+id/textView"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true"
    android:textSize="@dimen/abc_text_size_display_3_material"
    android:textColor="#ff0000" />
</RelativeLayout>

In my activity I did this:

import android.support.v7.app.ActionBarActivity;
import org.androidannotations.annotations.EActivity;

@EActivity(R.layout.activity_comentarios)
public class ComentariosActivity extends ActionBarActivity {

}

I tried to remove the line

  

@EActivity (R.layout.activity_comments)

It worked however when I enter the screen it becomes all orange as in the image.

Incaseitshouldlooklikethis:

NoLogcatthiserrorappears:

  

Error:(7,1)error:TheAndroidManifest.xmlfilecontainstheoriginalcomponent,andnottheAndroidAnnotationsgeneratedcomponent.PleaseregisterCommentsActivity_insteadofCommentsActivity

InmyAndroidManifestitlookslikethis:

<activityandroid:name=".ComentariosActivity"
       android:label="Comentarios"
       android:screenOrientation="portrait" />
    
asked by anonymous 22.05.2017 / 21:19

2 answers

1

I was able to solve the problem, just change my class to:

package com.fomedemais.FomeDemais;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import org.androidannotations.annotations.EActivity;


public class ComentariosActivity extends ActionBarActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_comentarios);
    }
}

And still add in AndroidManifest as my friend's answer @sparkss

<activity android:name=".ComentariosActivity_"
  android:label="Comentarios"
  android:screenOrientation="portrait" />
    
22.05.2017 / 21:55
3

Error itself already gives solution

  

Please register CommentsActivity_ instead of CommentsActivity

, in AndroidManifest put:

<activity android:name=".ComentariosActivity_"
   android:label="Comentarios"
   android:screenOrientation="portrait" />
    
22.05.2017 / 21:56