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

Android Build an Interactive Story App (Retired) Intents and Multiple Activities Adding a Second Activity

Mohammad Saqib
Mohammad Saqib
839 Points

I have added startStory() method but it is showing me method can not be resolved.

mStartButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String name = mNameField.getText().toString(); //Toast.makeText(MainActivity.this,name,Toast.LENGTH_LONG).show(); startStroy(); } }); }

private void startStory(){

    Intet intent1 = new Intent(this,StoryActivity.class);
    startActivity(intent1);

}

there are 2 errors :

  1. startStroy Method can not be resolved.
  2. startActivity in activity can not be applied to intent

thanks

Saqib

Jack Faassen
Jack Faassen
7,482 Points

DId you use startStroy for your method? Maybe it is a typo? change it to Startstory ?

I guess it's due to the typo, you typed Intet instead of Intent.