Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android on Intellij showing error: is not an activity

I have just imported my android project into intellij from eclipse. I am new to intellij.

I have gotten everything working and set up the run configuration for Android. When I run it, it gives me the edit configuration screen.

When I say launch the default activity, it tells me that it can't find the default activity, which is odd. When I code the activity to launch straight away, it tells me that that's not an activity subclass or alias. I double-checked and the class is certainly an activity.

When I ignore it and run anyway, it blows up as soon as it hits the phone.

Can you help me understand/fix these errors, please?

like image 296
Thom Avatar asked Jan 15 '14 17:01

Thom


2 Answers

In the Intellij project structure dialog, select the module that your Activity is residing in.

Then under the sources tab, add the root folder of your sources as sources for this module by clicking the 'Mark as Sources' link or button. The sources root folder should be mark blue.

The module can now find your sources and launch the activity.

like image 158
gbuys Avatar answered Oct 09 '22 11:10

gbuys


My solution was to delete and recreate the run configuration.

like image 29
inky Avatar answered Oct 09 '22 10:10

inky