xml components are not loaded in activity

0

Edition:

  

I just discovered that if you comment on the lines that cause the error,   it gets the screen all black ... that is, it does not load the layout.

I'm trying to get a ProgressBar and a TextView to be able to make changes according to an AsyncTask. It's worth mentioning that at the time the project was created, the main activity is not this, this one (named after SplashScreen) was created later (I'm talking about this because I'm a beginner and I'm not aware if something can affect if I left something behind ).

protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.splash_screen);

    /* New Handler to start the Menu-Activity
     * and close this Splash-Screen after some seconds.*/

    mProgressBar = (ProgressBar) this.findViewById(R.id.progressBar);
    mProgressText = (TextView) this.findViewById(R.id.progressBarTextView);

    try {
        new WSCatalogo91(this).execute();
    } catch (SQLException e) {
        e.printStackTrace();
    }
}

The return of the lines where findViewById is made is always null.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context=".SplashScreen">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/logoSplashScreen"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true" />

    <TextView android:text="@string/progressBar" android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:id="@+id/progressBarTextView"
        android:maxWidth="400dp"
        android:maxHeight="400dp"/>

    <ProgressBar
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/progressBar"
        android:indeterminate="false"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="165dp"
        android:minWidth="300dp" />

</RelativeLayout>

Manifest:

<activity
    android:name="com.universo91.catalogo91_android.activity.MainActivity"
    android:label="@string/app_name"
    android:screenOrientation="landscape" >
</activity>


<activity
    android:name="com.universo91.catalogo91_android.activity.SplashScreen"
    android:label="@string/title_activity_splash_screen"
    android:theme="@android:style/Theme.NoTitleBar"
    android:screenOrientation="landscape" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>


<activity
    android:name="com.universo91.catalogo91_android.activity.Login"
    android:label="@string/title_activity_login"
    android:screenOrientation="landscape">
</activity>
    
asked by anonymous 02.12.2014 / 14:56

0 answers