user3529582 February 2016

Unable to start activity componentinfo (error en setContentView)

I know this is a highlight topic, but I can't find my mistake...

I have this in my .MainActivity:

public class MainActivity extends Activity{

...

    public void abrirAppMovimiento(View view) {
        Intent mov = new Intent(this, Movimiento.class);
        startActivity(mov);
    }

...

}

This is my AndroidManifest.xml:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.emiliomorillanieto.practica3" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".Movimiento"
            android:parentActivityName=".MainActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity" />
        </activity>
    </application>

</manifest>

And this is the class .Movimiento:

public class Movimiento extends Activity implements SensorEventListener {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_movimiento);
      }
 }

I have being debugging the app, and when the app enters to .Movimiento, savedInstanceState is null, but the error comes while

Answers


Amit Vaghela February 2016

The inflate exception is not a problem here , but here this comes from another issue in your layout that is out of memory exception.

A common issue is an out of memory exception when you are trying to inflate an imageview loading a drawable resource. If one of this resources has a high pixel resolution it would take a lot of memory causing then an inflate exception.

So do verify that the pixel resolution in your drawables images are minimum necessary for your layout.

Checkout out of memory issue with good explaination.

Hope this helps.

Post Status

Asked in February 2016
Viewed 2,580 times
Voted 14
Answered 1 times

Search




Leave an answer