Michael Pailer
Michael Pailer

Reputation: 11

How do I get an application to run

I am new to this programming enviroment and am having trouble getting my application to start.. I tried the Hello World app and had the same problem... How do I set the main activity as (CLASS MAIN) and how do I refer to a non static method in a static...

I have tried

public static void main(String[] args){
CLASS DEFINE = NEW CLASS();
DEFINE.METHOD();
}

But it does not work.... It keeps showing me the class editor box saying to choose an attachment, but have no idea what the attachment would be or were to find it...

I started a basic project just to see if I could get it to run, but the result is the same.. It says that the process has stopped unexpectedly and only gives the option to force close...

I can not figure out how to get the application started....

Any help would be welcome...

Thanks...

Upvotes: 1

Views: 49

Answers (1)

Daniel Krzyczkowski
Daniel Krzyczkowski

Reputation: 3157

1) If you are writing your application in Android Studio please open Manifest file:

enter image description here

2) Find the Activity which will be the start Activity (in my case it is Login Activity) and add this inside it (like on the screen below):

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

enter image description here

Hope this will help.

Upvotes: 2

Related Questions