Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

application stopped unexpectedly - blog reader

no errors present, code launches fine, but won't run. I have looked up and down this for errors.

package com.example.blogreader;

import android.app.ListActivity; import android.os.Bundle; import android.view.Menu; import android.widget.ArrayAdapter;

public class MainListActivity extends ListActivity {

protected String[] mAndroidNames = {
    "Android beta",
    "Android 1.0",
    "Android 1.1",
    "Cupcake",
    "Donut",
    "Eclair",
    "Frayo",
    "Gingerbread",
    "Honeycomb",
    "Ice Cream Sandwich",
    "Jelly Bean"
};

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main_list);


    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mAndroidNames);
    setListAdapter(adapter);
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main_list, menu);
    return true;
}

}

2 Answers

Eduardo - check right after you get the fatal exception error. What is the next line? I had a android inflator excpetion, and binary XML error. I found that the <TextView in my xml layout was <Textview with a v and it should be a V. check urs.

rich

The same problem in the same situation, in the log, after lauch de app there are a lot of erros and the first one is "FATAL EXCEPTION:main"