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 a Self-Destructing Message Android App Starting the App Adding the Login Screen

Start Activity Error 1

I'm new to Android and I'm trying to develop the Ribbit App. I receive an error while adding these below 2 lines in the Main Activity where we add the intent so that we can invoke the Login Activity when the App starts.

The problem is specific to starting an Activity and the compiler says or suggests that startActivity is a method and should have a return type.

Why does this work in Eclipse and not in Android Studio.

Intent intent = new Intent(this, LoginActivity.class);

startActivity(intent);

I'm using Android Studio and Geny Motion and I'm unsure what am I doing wrong? Can any one point me in the right direction

1 Answer

Sorry ! I fixed the error ! My bad !