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 trialRonald Greer
Front End Web Development Techdegree Graduate 56,430 PointsCan anyone help me with this android code challenge?
I've rewatched the video multiple times, but i haven't been able to get passed this. if anyone can point me to where i can find the answer i am looking for or give me the answer, that'd be great.
public class MainActivity extends AppCompatActivity {
TextView counter;
Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
counter = (TextView) findViewById(R.id.textView);
button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int count = Integer.parseInt(counter.getText().toString());
counter.setText(Integer.toString(count + 1));
}
});
}
}
public interface MainActivityView {
}
public class MainActivityPresenter {
}