Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.