an anyone look at this simple code (?) and tell me what’s wrong please?
I’m a complete beginner to android development and I don’t understand why my application doesn’t even start. I get an unexpected error.. : (
Here it is:
package applicationTest.ppr.com;
import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
public class MainClass extends Activity {
/** Called when the activity is first created. */
/*Global vars*/
public static LinearLayout lila;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
lila = (LinearLayout) findViewById(R.id.lilay);
setContentView(lila);
}
public void Shortoast(){new Game(this);}
public static LinearLayout returnLayout(){return lila;}
}
The program doesn’t even launch, and I think it might have something to do with how I handle the LinearLayout and setContentView();
anyway thanks very much in advance!
Suggestion: keep it as simple as possible until you fix the issue!
Then you can concentrate on your business logic.
Also, is your main activity mapped in the Android manifest?
–EDIT–
Do you have the lilay.xml file in your res/layout folder?