Error while Launching activity 解决方案:

1 使用adb 写在包再启动程序 adb uninstall 包名
如果没有adb命令:
(1)创建.bash_profile文件(命令输入 touch .bash_profile)
(2)打开.bash_profile文件(命令输入 open -e .bash_profile)
(3)在打开的.bash_profile文件中编辑 : export PATH=${PATH}:/Users/你自己的用户名/Library/Android/sdk/platform-tools
编辑完成之后,保存,退出;
(4)执行命令 source .bash_profile;
(5)输入,adb version 出现版本号即成功 最后执行 adb uninstall 包名 输出Success 再重新启动程序

2 在Manifest.xml里有没有声明两个Activity作为Launcher

3 在清单中,将你的第一个启动类,加上过滤代码 复制整个intent-filter 添加到你的第一个启动类中

<activity android:name=".MainActivity">
  <intent-filter>
    <action android:name="android.intent.action.MAIN" />

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

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>