You have to create a new proyect, charge the donwloaded code and start playing... the more common fail is in the variable declaration. It seems like the file R.java is a variable file declaration. Usually R.java went unfilled in all android-page tutorials, so for the begginers (like me) you have to know two things:
R.java is an auto-generated file and the header says "This class was automatically generated by the aapt tool from the resource data it found. It should not be modified by hand." This is probably ok if you starts a proyect from zero but we have a coupple of files and an empty R.java class. We need to filled it by hand. Dont worry about this, if you commit a mistake Netbeans should fix it.
4 example:
package com.android.demo.notepad3;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class id {
public static final int body=0x7f050001;
public static final int confirm=0x7f050002;
public static final int text1=0x7f050003;
public static final int title=0x7f050000;
}
public static final class layout {
public static final int main=0x7f030000;
public static final int note_edit=0x7f030001;
public static final int notes_list=0x7f030002;
public static final int notes_row=0x7f030003;
}
public static final class string {
public static final int app_name=0x7f040000;
public static final int body=0x7f040005;
public static final int confirm=0x7f040006;
public static final int edit_note=0x7f040007;
public static final int menu_delete=0x7f040003;
public static final int menu_insert=0x7f040002;
public static final int no_notes=0x7f040001;
public static final int title=0x7f040004;
}
}
It looks ok after modify the R.java and it runs well :)
This are the results.. i dont know why i see chinese words in the predictive dictionary :(


Cheers!

No hay comentarios:
Publicar un comentario