Q:

Can't get my if statement to work?

I know this has got to be simple. But for the life of me i don't know why i can't get this right. 
Ok so I want to go from a listview page (got that) then click a switch to make it go to the next page (also got that.) Then I want a int to tell me which position I am on form the last page (might be working?) now i can't get the If Else statement to work in the page.
public class NightmareParts extends Activity
{
    public int current_AN_Number = NightmareList.AN_position_num;
    private TextView edit_title;
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.part_layout);

        // isn't working here. Why?
        // test_edit = (TextView)findViewById(R.id.directions_tv);        
        // test_edit.setText(R.string.directions_text_two);                 
        // works without this being in here. 

        setDoneButtonListener();
    }

    //Set up the Done button to initialize intent and finish
    private void setDoneButtonListener()
    {
        Button doneButton = (Button) findViewById(R.id.back_button);
        doneButton.setOnClickListener (new View.OnClickListener() {
            @Override
            public void onClick(View v)
            {
                finish();
            }
        });
    }

    private void editTitle()
    {
        if (current_AN_Number = 1)
        {
            edit_title = (TextView)findViewById(R.id.part_title);           
            edit_title.setText(R.string.AN_title_1);                        
        }           
    }
}

The current_AN_number is coming from the last page.

A:

Your if statement is incorrect:
if (current_AN_Number = 1)

You've used the assignment operator, when you wanted to compare it with the == operator:
if (current_AN_Number == 1)

