Android_bug之Default Activity not found

在运行自己修改默认的MainActivety,运行自己的Mainactivety时,碰到这个问题Could not identify launch activity: Default Activity not found

这个错误可能出现在run之后的Run的信息框中: 
这里写图片描述

或者 
这里写图片描述 
这里写图片描述

在这里可以看到关于运行的选项,是选择默认的activity还是指定的activity进行运行,我们的问题就出在和activity相关地方

这里写图片描述

如果我们选定指定的activity进行运行,就会发现报另外一个错误

这里写图片描述

现在我们发现,是因为在AndroidManifest.xml中没有定义activity,在其中的中间加上activity的定义就行了

<manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="zding.focuscircle">     <application         android:allowBackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:supportsRtl="true"         android:theme="@style/AppTheme">         <activity             android:name="zding.focuscircle.FocusCircleActivity"             android:label="@string/app_name">             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                 <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application> </manifest>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

这样,问题就解决了

这里写图片描述

原文地址:https://www.cnblogs.com/jym-sunshine/p/5635977.html