$ adb shell am start -n "com.hlx.administrator.hello/com.hlx.administrator.hello.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Unexpected error while executing: am start -n "com.hlx.administrator.hello/com.hlx.administrator.hello.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity

第一种情况:有MAIN,无LAUNCHER,程序列表中无图标 原因:android.intent.category.LAUNCHER决定应用程序是否显示在程序列表里 
第二种情况:无MAIN,有LAUNCHER,程序列表中无图标

原因:android.intent.action.MAIN决定应用程序最先启动的Activity,如果没有Main,则不知启动哪个Activity,故也不会有图标出现


解决方案:

 (1)修改AndroidManifest.XML文件

<?xml version="1.0" encoding="utf-8"?>                                                                                 -------这是必须要添加的部分:------------                                                                         -------------------------------------------    
(2)添加如图所示:res|values|strings.xml|Hello2

  

 运行OK


更多相关文章

  1. shell批量转换iOS和Android图标
  2. Qt for Android程序沉浸式启动页面(去除标题栏、去除黑屏、保留后
  3. 扩大攻击层面:React Native Android应用程序
  4. Android全面解析之Context机制
  5. Android(安卓)系列 4.6在显示其他应用程序的同时运行后台服务
  6. Android冷启动与热启动概念
  7. 【Android】webView 使用 系统自带搜索对话框问题
  8. Android下的一种编程框架
  9. Xamarin.Android-捕获未处理异常(全局异常)

随机推荐

  1. Selenium InternetExplorerDriver无法找
  2. 适配器模式和外观模式
  3. jsoup 分页抓取网页数据Java HTML Parser
  4. [LeetCode] 212. Word Search II 词语搜
  5. Blue Pelican Java项目“Masking Telemet
  6. java入门第三篇-面向对象;
  7. 错误:警告:无法从javaldx读取路径
  8. 用户的身份证号和手机号验证
  9. Play 2.0生成隐藏字段而不使用div包装器
  10. Java高并发秒时啊API之Service层