Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default Activity not found in Android Studio

I just upgraded to Android Studio 0.2.8 and I am getting an error that says "Default Activity not found" when I try to edit the run configurations.

When I launch Android Studio I get this error "Access is allowed from event dispatch thread only"

The activity I am using is a fragment activity.

So far I've tried rebuilding and invalidate caches/restart. Both were of no use.

Please let me know what I can do to fix the problem.

like image 416
Vipassana Vijayarangan Avatar asked Sep 16 '13 12:09

Vipassana Vijayarangan


People also ask

How do I determine the default activity using Android Studio?

In Android, you can configure the starting activity (default activity) of your application via following “intent-filter” in “AndroidManifest. xml“. See following code snippet to configure a activity class “logoActivity” as the default activity.

What is MainActivity this in Android?

Typically, one activity in an app is specified as the main activity, which is the first screen to appear when the user launches the app. Each activity can then start another activity in order to perform different actions.


1 Answers

Have you added ACTION_MAIN intent filter to your main activity? If you don't add this, then android won't know which activity to launch as the main activity.

ex:

<intent-filter>       <action android:name="android.intent.action.MAIN"/>       <action android:name="com.package.name.MyActivity"/>       <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> 
like image 151
Anup Cowkur Avatar answered Oct 12 '22 22:10

Anup Cowkur