如何运行应用程序

时间:2022-06-13 07:32:32

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...

我是这个编程环境的新手,我无法启动我的应用程序..我尝试了Hello World应用程序并遇到了同样的问题...如何将主要活动设置为(CLASS MAIN)以及如何引用静态中的非静态方法...

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...

1 个解决方案

#1


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

1)如果您在Android Studio中编写应用程序,请打开Manifest文件:

如何运行应用程序

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):

2)找到将作为开始活动的Activity(在我的例子中是Login Activity)并在其中添加(如下面的屏幕):

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

如何运行应用程序

Hope this will help.

希望这会有所帮助。

#1


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

1)如果您在Android Studio中编写应用程序,请打开Manifest文件:

如何运行应用程序

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):

2)找到将作为开始活动的Activity(在我的例子中是Login Activity)并在其中添加(如下面的屏幕):

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

如何运行应用程序

Hope this will help.

希望这会有所帮助。