开发者

Adding a new class to Android Project

开发者 https://www.devze.com 2023-02-11 12:26 出处:网络
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 dis

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 n开发者_运维问答ow. 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


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.


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{

}

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号