Understanding Crashes & ANRs at Developer console
<p>On my Developer Console I can see that my app as a crash. It is a <code>java.lang.NullPointerException</code>.</p>

<p>Opening the crash Stack trace I get this:</p>

<pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nutridatalite.mgm/com.nutridatalite.mgm.Infodata}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
at android.app.ActivityThread.access$1500(ActivityThread.java:121)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3770)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.nutridatalite.mgm.Infodata.onCreate(Unknown Source)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
... 11 more
</code></pre>

<p>I can see the Class where the error is being generated but I can't understand what is causing the error.</p>

<p>Is there a way to have a more detailed log?
When using the phone connected to the IDE when we have a crash, the line number where the error happens it's shown.</p>

<p>Any suggestions?</p>

<p>Here is the Infodata Class</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // COLOCA O LAYOUT RESPECTIVO
        setContentView(R.layout.maindata);

        // Lista
        listContent = (ListView) findViewById(R.id.listMacro);

        // Barra
        add = (Button) findViewById(R.id.dataMais);
        sub = (Button) findViewById(R.id.dataMenos);
        // barraValor = (TextView) findViewById(R.id.dataSeekBarValue);
        barra = (SeekBar) findViewById(R.id.dataSeekBar);
        barra.setOnSeekBarChangeListener(this);

        // EXTRAI OS VALORES DOS DADOS E INICIALIZA OS CAMPOS DE TEXTO
        setDefaultValues();
        extraiValores();
        extraiValoresDRI(driChoice);
        tvFOODDES = (TextView) findViewById(R.id.dataFoodName);

        // Coloca a medida predefinida
        if (alimentoFOODGROUP == 98 || alimentoFOODGROUP == 99) {
            defaultMeasure = "100ml";
        } else {
            defaultMeasure = "100g";
        }

        // Controlar o tamanho da letra
        if (alimentoFOODDES.length() &lt;= 20) {
            tvFOODDES.setText(alimentoFOODDES);
        } else if (alimentoFOODDES.length() &gt; 20 &amp;&amp; alimentoFOODDES.length() &lt;= 40) {
            tvFOODDES.setTextSize(25);
            tvFOODDES.setText(alimentoFOODDES);
        } else {
            tvFOODDES.setTextSize(20);
            tvFOODDES.setText(alimentoFOODDES);
        }

        // INICIALIZA O NUTRIENT DATA
        startNutrientData();

        // TRATA DO SPINNER
        spinner = (Spinner) findViewById(R.id.availableValues);
        spinner.setOnItemSelectedListener(this);
        loadSpinner(-1);

        // A QUANTIDADE DE ALIMENTO POR OMISSAO SAO AS 100 G/ML
        qtd = 100;

        // COLOCAR A FONTE DOS DADOS
        if (alimentoSOURCE == 1 || alimentoSOURCE == 2) {
            if (NutriData.dbInUse == 1) {
                valueSource = getString(R.string.dataFontPt);
                // tvSOURCE.setText(getString(R.string.dataFontPt));
            } else if (NutriData.dbInUse == 2) {
                if (alimentoSOURCE == 1) {
                    valueSource = getString(R.string.dataFontBr);
                } else {
                    valueSource = getString(R.string.dataFontBr2);
                }
            } else if (NutriData.dbInUse == 3) {
                valueSource = getString(R.string.dataFontUs);
            } else if (NutriData.dbInUse == 4) {
                valueSource = getString(R.string.dataFontUk);
            }
        } else {
            valueSource = getString(R.string.dataFont2);
        }

        // COLOCA O SIGNIFICADO DE ND
        valueND = getString(R.string.dataND);
        // COLOCA O SIGNIFICADO DE TR
        valueTR = getString(R.string.dataTR);

        // Controla os botoes de mais e menos
        add.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                upgradeDialog();
            }
        });
        sub.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                upgradeDialog();
            }
        });
    }
</code></pre>
