Why setText causes my program to fail while Toast doesn't : The setText method when un-commented crashes the Activity/program. However, when it's just the TOAST with the same variable it works perfectly.



        int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
        int min = Calendar.getInstance().get((Calendar.MINUTE));

        int ft = hour + min;

        int second = Calendar.getInstance().get(Calendar.SECOND);
        if(second<10){
            second = second + 10;
        }

        String sft = Integer.toString(ft);
        String ssecond = Integer.toString(second);
        fid = sft + ssecond;


        Toast.makeText(addRoll.this, fid, Toast.LENGTH_LONG).show();
        id.setText(fid);


So this should change the TextView into the 4 digit number created. currently, it is at 0000. I know the variable works because the toast shows the correct variable. Thanks in advance.