"Pro Android 3" Book Example Code Question
Hello, All, and thank you for providing these great forums!
I'm new to Java and picked up the book "Pro Android 3" by Komatineni, MacLean, and Hashimi the other day.
So, while going through it, I ran across this part [page 45]:
Quote:
The application's root package name is defined as an attribute of the <manifest> element in the AndroidManifest.xml file, and each activity has a name attribute.
Once the entry-point activity is determined, the host starts the activity and the onCreate() method is called. Let's have a look at NotesList.onCreate(), shown in listing 2-2.
Code java:
public class NotesList extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT);
Intent intent = getIntent();
if (intent.getData() == null) {
intent.setData(Notes.CONTENT_URI);
}
getListView().setOnCreateContextMenuListener(this);
// rest of code listed in the book left out for brevity
My problem is that I can't find that code in any file or folder showing up in Eclipse's "Project Explorer"/"Navigator." (I'm using Eclipse "Version: Indigo Service Release 2 -- Build id: 20120216-1857" by the way.)
Can somebody please point me in the right direction?
Re: "Pro Android 3" Book Example Code Question
Wow. Please disregard the OP above. I found the problem -- after studying java almost non-stop for the past few days. It seems the code in the book does not accurately reflect what's in the actual NotesList.java src file. The writers/editors have removed the comments that appear in the actual java file and re-arranged the spacing of some of the lines so it looks at first glance as if the code isn't the same (especially if you're totally new to java), but the code is indeed the same -- it just looks different.
Thanks anyway! :-B