Android Build a Simple Android App Basic Android Programming Initializing a Button

I dont understand what I'm doing wrong?

I'm trying to complete the challenge but I seem to be troubled with the codes & the order or syntax.

FunFactsActivity.java
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class FunFactsActivity extends Activity {


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

        // Declare our View variables and assign them the Views from the layout file
        TextView factLabel = (TextView) findViewById(R.id.factTextView);
        Button showFactButton = (Button) findViewById(ShowFactButton);

    }
}

2 Answers

Raffael Dettling
Raffael Dettling
31,039 Points

Use R.id.showFactButton you got ShowFactButton it´s case sensitiv :)

thank you I will go ahead & give it a try.