Note that there are some explanatory texts on larger screens.

plurals
  1. POThe application has stopped unexpectedly and all im trying to do is activate a button and go into another screen
    primarykey
    data
    text
    <p>I am doing a simple test to see if i can make an android game. All im tryihg to do is when the user clicks on my start button it goes into the game screen that for now says "Game screen" however when i click on the button it says the application has stopped Unexpected error has occured and i am forced to shut down.</p> <p>I am new to eclipse and android but i am not new to java and my code has no errors</p> <p>So if someone can help me fix this problem i would very much appreciate it </p> <p>Here is my main:</p> <pre><code>import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); buttonClickMethod(); } private void buttonClickMethod() { // TODO Auto-generated method stub Button start = (Button) findViewById(R.id.startB); start.setOnClickListener( new OnClickListener(){ public void onClick(View v){ Intent i = new Intent(v.getContext(), GameView.class); startActivityForResult(i,0); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } </code></pre> <p>here is my gameView code:</p> <pre><code>package com.example.coloroblind; import android.app.Activity; import android.os.Bundle; public class GameView extends Activity{ protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.game); } } </code></pre> <p>thanks for your input</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload