4

I'm a long time windows developer looking to learn something about Android programming. I'm working my way through the Sams book Teach Yourself Android Application Programming in 24 hours. I've discovered some flaws with the book already but nothing that I couldn't figure out on my own, until now. I'm working on adding a second class to my project and in the New Java Class dialog, it says to click the Browse button next to the Superclass box and pick "android.app.Activity". However, the only thing shown is java.lang.Object.

I'm pretty certain that I've set thing up correctly, but then, maybe I haven't.

Can anyone give me guidance?

Thanks!

Bo

1
  • I'm not sure how to make the Browse button work, but you can always type or paste "android.app.Activity" for the super class name. Commented Feb 16, 2011 at 2:51

2 Answers 2

3

The browse button tries to do an auto-match based on what is currently in the Superclass text box.

Delete java.lang.Object and enter Act (for example) then click Browse and see what you get. ;-)

BTW - I'm assuming you're using Eclipse? If so, confirm and someone will retag the question as it's more of an Eclipse usage question rather than Android specific.

Sign up to request clarification or add additional context in comments.

4 Comments

Right, Eclipse. Should have thought to mention that. This answers the question. Thanks!
@bo gusman: Glad to help - it actually confused the heck out of me too when I first started using Eclipse. I've added an eclipse tag to your original question to help anyone searching a similar issue.
roger that confusion. I'll no doubt invoke the wrath of the Eclipse Gods when I say that it just can't hold a candle to Visual Studio. Sorry, Gods, that's the simple truth, at least for this dev. :)
@bo gusman: I've programmed C# with VS 2003-2008 and have to admit it took me a few months to get used to Eclipse but I'm pretty comfortable with it now and I'm quite happy with it for Android developing now I know my way around.
1

After creating a class you can just extend it ..

Create a class and then manually add the part in bold

public class MyActivity extends android.app.Activity{

}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.