I am having a problem in Android where I cannot set the text of a TextView to an int without my application crashing. Does anyone else have this problem? I tried changing the int to "static int" as I saw in a suggestion, but it still doesn't work. Android's website says I should be able to do this, but it doesn't work. I also tried .setText("Hello"); to it and it does work, it just doesn't when I try to assign it an int. What am I doing wrong?

Here is a snippet:

TextView press_count = (TextView)findViewById(R.id.press_count);
press_count.setText(num_pressed);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.