Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5840771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:47:51+00:00 2026-05-22T11:47:51+00:00

an anyone look at this simple code (?) and tell me what’s wrong please?

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:47:52+00:00Added an answer on May 22, 2026 at 11:47 am

    Suggestion: keep it as simple as possible until you fix the issue!
    Then you can concentrate on your business logic.

    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. */
    
        @Override
        public void onCreate(Bundle savedInstanceState) {       
            super.onCreate(savedInstanceState);
            setContentView(R.id.lilay);
        }
    
    }
    

    Also, is your main activity mapped in the Android manifest?

    <application android:icon="@drawable/icon" android:label="@string/app_name">
    
        <activity android:name="MainClass"
                  android:label="@string/app_name">
    
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
    
        </activity>
    
    </application>
    
    </activity>
    

    –EDIT–
    Do you have the lilay.xml file in your res/layout folder?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know tools which look at a MySQL database, show you all the
Does anyone have any tips or gotcha moments to look out for when trying
Can anyone recommend a free grid/graphing component for C#/.NET? I'm having a look at
I was wondering if anyone had an example of what an array would look
edit #2: Question solved halfways. Look below As a follow-up question, does anyone know
Anyone know how to do this without using a third party program? If there
Can anyone tell me how to get a array of bytes into a structure
I have written simple code to determine country location using the suffix on the
Anyone know if it's possible to databind the ScaleX and ScaleY of a render
Anyone know of a way to capture keyboard events (keyup / keydown) in Portable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.