Notepad Tutorial Version 2 Problems


Last Updated:

  1. Arigead

    Arigead Member This Topic's Starter

    Joined:
    Nov 24, 2009
    Messages:
    5
    Likes Received:
    0
    I've been working through the Notepad Tutorials shipped with Android and struggling as I can't get the second version to work:

    Android Developers

    I've run this application on both a phone (HTC Hero) and in Eclipse in the emulator and there is no context menu for each added note to Delete the note or Edit it. I've tried changing the minimum version of the project and have been using the solution version of the project instead of the one I completed and still no joy.

    Has anybody gotten this project working. I'd really like to see the Context Menu working as I'd like to use it in other apps.

    Thanks in advance for any help.
     

    Advertisement
  2. scottbiggs

    scottbiggs New Member

    Joined:
    Aug 31, 2010
    Messages:
    1
    Likes Received:
    0
    Yeah, I see this is a popular topic--almost a year with no follow-ups. I've been having problems with the same bit of the Notepad tutorial. For me, the program runs and does *nothing*.

    I had a hell of a time compiling the damn thing as command-shift-O initially inserted the line:

    import android.R;

    which overrides my own R.java files.

    But I'm at a loss as to why the program fails to respond to any user input at all. Time to bear down and work at this bug!
    -smb
     
  3. IanGClifton

    IanGClifton Well-Known Member

    Joined:
    Feb 7, 2010
    Messages:
    111
    Likes Received:
    19
    I never ran through the notepad tutorials before but I just grabbed the V2 solution and built it to the emulator against Android 2.2. If I long press (well, long click) on a note I've added, I get the "Delete Note" option in the context menu. A regular click brings the note up for editing (and pressing back crashes it, haha).

    What happens when you guys tap a note? What about long press?
     
  4. jetak

    jetak New Member

    Joined:
    Aug 30, 2010
    Messages:
    2
    Likes Received:
    0
    Yeah, a long press on the actual note brings up a delete note menu, a short press (tap) bring up the editor and pressing the Menu Button brings up the Add Note option. The Tutorial instructions do not make this very clear.

    I also had a hell of a time with the auto generation of the R.java file. I had to modify the provided note_edit.xml file. Any place that had "match_parent" I had to change to "wrap_content".

    i.e android:layout_width="match_parent" -> android:layout_width="wrap_content"

    Without this change Eclipse complained:
    blah blah blah.

    After the change and removing all the import android.R that cmd-shift-O brought in I was able to rebuild and get the app running.
     
  5. IanGClifton

    IanGClifton Well-Known Member

    Joined:
    Feb 7, 2010
    Messages:
    111
    Likes Received:
    19
    "match_parent" is the same as "fill_parent." If Eclipse does not recognize it, you need to verify that you are building against 2.2
     
    Moonfire likes this.
  6. heinduplessis

    heinduplessis Active Member

    Joined:
    Jul 8, 2010
    Messages:
    31
    Likes Received:
    0
    Now *this* is a valuable piece of information. Thanks!

    Wish google's tutorials would stop stating the obvious and clear up the mysteries!
     

Share This Page

Loading...