0

I'm new in the android development. I have got 2 classes in my package : IMC and Test. I have also 2 xml file in res/layout : activity_xml and activity_test.

I'd like to run my class "Test" but when I click on the "Run" button, the Eclipse console says ="[2013-11-25 16:30:40 - SdZ] Performing com.example.sdz.IMC activity launch".

How could I configure Eclipse so it could run com.example.sdz.Test?

tshepang
  • 12,111
  • 21
  • 91
  • 136

2 Answers2

0

From eclipse FAQ:

"Eclipse is not only a Java development environment. To deal with everything that can be launched with it—Java programs, JUnit tests, Enterprise JavaBeans™ (EJBs), even Eclipse itself—Eclipse defines the concept of launch configurations. When you click the Run button, click on Java Application, fill out the details, and click Run. The next time, your program will be launched automatically when you click the Run button (or press Ctrl+F11). To alter your launch configuration or to create a new one, select the Run... menu option, in the Run button drop-down menu. Alternatively, you can edit a launch configuration by holding down Ctrl and clicking on the launch you want to edit in the Run or Debug button drop-down list."

So, when running you class for the first time, choose your class and click the small arrow close to the run button, then select "Run As..." > "Java application".

dstronczak
  • 2,406
  • 4
  • 28
  • 41
0

change your main activity in manifest file

  <activity
        android:name="com.example.sdz.Test">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

now it will launch this activity first.

Hamad
  • 5,096
  • 13
  • 37
  • 65