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 Build a Simple Android App (2014) Coding the Fun Facts Using an Array

Joshua Schoen
Joshua Schoen
900 Points

Have an error that does not allow me too continue

It's an error called : Cannot resolve Symbol. Or It will be Cannot Resolve Method. Don't know where you can post a picture, so I cant show a screenshot. private FunBook m*Funbook = new *FunBook();

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


    // Declare our view variables % assign them the views from the layout files ^_^
    final TextView factLabel = (TextView) findViewById(R.id.FunFactText);
    Button showFactButton = (Button) findViewById(R.id.MySwaggyButton);
    View.OnClickListener listener;
    listener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
        String fact = mFunbook.*getFact*();
        }
        //Updates Fact :)

        factLabel.setText("")

       };
    }

MySwaggyButton.*SetOnClickListener*()

Above is what my code is. Code I've quoted with The astrik is the code that has the " Cannot resolve Symbol/Cannot Resolve Method.

2 Answers

In which Code Challenge (and which task) do you get this problem? I have tried to check out the Using an Array Code Challenge, but I cannot recognize your presented code with that code.

I can see that you forgot the semicolon ";" in the following lines, telling the compiler that you would like to end the statements. I do not know what the task is about, though.

        factLabel.setText("")

and this line too:

MySwaggyButton.*SetOnClickListener*()
Joshua Schoen
Joshua Schoen
900 Points

Oh, I didn't mean this question. I'm new to this site, and haven't figured out how to post relative questions. This is a common problem has nothing to do with the quiz. Sorry if it was misleading. xD The screenshot is my android project, and I have an error within it lol " Cannot resolve method/ Cannot Resolve Symbol.