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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Muhammad Sodikin](https://uploads.teamtreehouse.com/production/profile-photos/3015372/micro_Photo_on_11-19-14_at_6.01_PM.jpg)
Muhammad Sodikin
2,815 Pointsstuck with Build an Interactive Story App where it states that " public void onClick (View v){ "...w
public void onClick (View v){
how to correct the error of small v there? because at the Log Cat it shows " error: ';' expected
3 Answers
![Jon Kussmann](https://uploads.teamtreehouse.com/production/profile-photos/2938922/micro_teamtreehouse_image.png)
Jon Kussmann
Courses Plus Student 7,254 PointsAh, that's a tough one to see.
In the line:
mStartButton.setOnClickListener(new View.OnClickListener()); {
You have an extra ");"
The line should be:
mStartButton.setOnClickListener(new View.OnClickListener() {
![Jon Kussmann](https://uploads.teamtreehouse.com/production/profile-photos/2938922/micro_teamtreehouse_image.png)
Jon Kussmann
Courses Plus Student 7,254 PointsHi,
Could you add the rest of the code to your onClick method? It's hard to tell what's going on without that.
![Muhammad Sodikin](https://uploads.teamtreehouse.com/production/profile-photos/3015372/micro_Photo_on_11-19-14_at_6.01_PM.jpg)
Muhammad Sodikin
2,815 PointsHello, the code is:
import android.content.Intent;
public class MainActivity extends ActionBarActivity {
private EditText mNameField;
private Button mStartButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mNameField = (EditText)findViewById(R.id.nameEditText);
mStartButton = (Button)findViewById(R.id.startButton);
mStartButton.setOnClickListener(new View.OnClickListener()); {
@Override
public void onClick (View v){
String name = mNameField.getText().toString();
startStory();
}
});
}
The Log Cat give is :
Error:(31, 32) error: ';' expected Error:(31, 40) error: ';' expected Error:(36, 10) error: illegal start of expression Error:Execution failed for task ':app:compileDebugJava'.
Compilation failed; see the compiler error output for details.
![Muhammad Sodikin](https://uploads.teamtreehouse.com/production/profile-photos/3015372/micro_Photo_on_11-19-14_at_6.01_PM.jpg)
Muhammad Sodikin
2,815 PointsAha. It was the "):". Lets have a drink. Thx.
![Jon Kussmann](https://uploads.teamtreehouse.com/production/profile-photos/2938922/micro_teamtreehouse_image.png)
Jon Kussmann
Courses Plus Student 7,254 PointsNo problem!
Muhammad Sodikin
2,815 PointsMuhammad Sodikin
2,815 PointsAre you sure? Haha.
how about the (View v) characters, the characters 'v' can't be resolved.
Jon Kussmann
Courses Plus Student 7,254 PointsJon Kussmann
Courses Plus Student 7,254 PointsI would make the change I suggested first. To me it seems as though 'v' cannot be resolved since you are ending that statement early because of the extra ");"
Go ahead and try it... if it doesn't work, we'll figure something else out. :P