R. id Ne peut pas être résolu

Je suppose que quelque chose doit être fait avec le Android-Manifest.xml fichier ou quelque chose dans la mise en page du dossier. Je suis nouveau sur Android donc je ne sais pas ce que je dois écrire.

public class AndroidPong extends Activity implements  OnClickListener {
static String tag;
@Override
protected void onCreate(Bundle savedInstanceState) {
//TODO Auto-generated method stub
super .onCreate(savedInstanceState);
tag = getResources().getString(R.string.app_name);
fullScreen();
splashScreen();
}
@Override
protected Dialog onCreateDialog(int id) {
//TODO Auto-generated method stub
return super .onCreateDialog(id);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//TODO Auto-generated method stub
return super .onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
//TODO Auto-generated method stub
return super .onOptionsItemSelected(item);
}
@Override
protected void onStop() {
//TODO Auto-generated method stub
super .onStop();
}
@Override
protected void onDestroy() {
//TODO Auto-generated method stub
super .onDestroy();
}
void startGame() {
setContentView(R.layout.game);//error
this .findViewById(R.id.Button01).setOnClickListener(this );//error
this .findViewById(R.id.Button02).setOnClickListener(this );//Error
}
void splashScreen() {
setContentView(R.layout.splash);//error
this .findViewById(R.id.pongtable).setOnClickListener(this );//error
}
void gameMenu() {
}
void fullScreen() {
this .requestWindowFeature(Window.FEATURE_NO_TITLE);
this .getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
public static void debug(String debug) {
Log.d(tag, debug);
}
<?xml version="1.0" encoding="utf-8"?>
<absoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<Button android:id="+id/Button02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
</absoluteLayout>
Vous pouvez poster la mise en page des fichiers XML? Est la mise en page XML dans /res/layout? Sont la mise en page des fichiers XML appelé game.xml et splash.xml?
game.xml <?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:id="+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </AbsoluteLayout>
Je donne un lien d'où j'ai copié ce code java2s.com/Open-Source/Android/Game/android-pong-kt/... dans ce il n'y a pas de manifeste android ,splash ,jeu fichier xml
Essayez de modifier votre question lors de l'ajout des informations de ce type. De cette façon, vous pouvez le formater donc sa belle et jolie et nous pouvons le lire 🙂
Buyn j'ai posté le fichier xml

OriginalL'auteur GameBuilder | 2011-06-02