- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
首先,我使用的是 Eclipse IDE。我正在尝试制作一个应用程序商店。我不知道发生了什么,但它以前有效,现在我在 LogCat 中收到此错误。
02-02 13:26:39.750: E/AndroidRuntime(280): FATAL EXCEPTION: main
02-02 13:26:39.750: E/AndroidRuntime(280): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.example.appstore.GAMENAME }
02-02 13:26:39.750: E/AndroidRuntime(280): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
02-02 13:26:39.750: E/AndroidRuntime(280): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
02-02 13:26:39.750: E/AndroidRuntime(280): at android.app.Activity.startActivityForResult(Activity.java:2817)
02-02 13:26:39.750: E/AndroidRuntime(280): at android.app.Activity.startActivity(Activity.java:2923)
02-02 13:26:39.750: E/AndroidRuntime(280): at com.servetech.appstore.MainActivity$1.onClick(MainActivity.java:28)
02-02 13:26:39.750: E/AndroidRuntime(280): at android.view.View.performClick(View.java:2408)
02-02 13:26:39.750: E/AndroidRuntime(280): at android.view.View$PerformClick.run(View.java:8816)
02-02 13:26:39.750: E/AndroidRuntime(280): at android.os.Handler.handleCallback(Handler.java:587)
02-02 13:26:39.750: E/AndroidRuntime(280): at android.os.Handler.dispatchMessage(Handler.java:92)
02-02 13:26:39.750: E/AndroidRuntime(280): at android.os.Looper.loop(Looper.java:123)
02-02 13:26:39.750: E/AndroidRuntime(280): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 13:26:39.750: E/AndroidRuntime(280): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 13:26:39.750: E/AndroidRuntime(280): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 13:26:39.750: E/AndroidRuntime(280): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 13:26:39.750: E/AndroidRuntime(280): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 13:26:39.750: E/AndroidRuntime(280): at dalvik.system.NativeStart.main(Native Method)
主 Activity .java
package com.servetech.appstore;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn = (Button) findViewById(R.id.button1);
btn.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent myIntent = new Intent("com.example.appstore.GAMENAME");
startActivity(myIntent);
}
});
}
}
Android list :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.servetech.appstore"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.servetech.appstore.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".GameName"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.servetech.appstore.GAMENAME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
PS:我注意到我启动 Activity 的方式与其他人略有不同。只是想让你知道我正在学习新波士顿教程。我希望这不是问题。如果需要,我可以发布 GameName 类。
编辑:已经解决了这个问题,所以不要浪费你的时间试图提供帮助:)
最佳答案
您尝试运行类 "com.example.appstore.GAMENAME
但在 list 中您得到了 packageName+.GameName
。所以不是 Intent myIntent = new Intent("com.example.appstore.GAMENAME");
试试 Intent myIntent = new Intent("com.servetech.appstore.GAMENAME");
关于Android 致命异常 ActivityNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21510224/
我的电脑正确配置了 SSH,我在尝试克隆存储库时遇到了这个错误: 我运行这个命令来克隆存储库 git clone ssh://git-codecommit.us-west-2.amazonaws.co
我试图下载android源代码。但是遇到了一个问题。 # repo init -u https://android.googlesource.com/platform/manifest fatal:
尝试运行我 4 年前开发的 Rails 4 项目,从那时起我一直在维护,我遇到了下一个错误,该错误在启动时卡住了应用程序: machine stack overflow in critical reg
这个问题在这里已经有了答案: psql: FATAL: role "postgres" does not exist (32 个答案) 关闭上个月。 我正在设置 Postgresql 以与 Rail
我正在创建新分支并尝试推送该分支(我尝试了以下命令): git push --all -u git push origin NewBranch 但在这两种情况下我都会收到此错误: Permission
我尝试克隆这个 repo 几次,但得到了同样的错误。是不是因为它太大而我的连接速度很慢? $ git clone https://git01.codeplex.com/typescript Cloni
我正在尝试使用 http://danielmiessler.com/study/git/#website 设置 git管理我的网站。 我已经到了指令的最后一步:git push website +ma
当我使用快速启动方法安装Eucalyptus云时,我看到安装失败。以后检查日志文件时,遇到以下错误。 最佳答案 错误消息是: Invalid gateway due to subnet/netmask
黄色, 我尝试按照以下步骤设置选项“在没有用户名和密码的情况下访问(推送到)Github”。 https://medium.com/@amanze.ogbonna/accessing-pushing-
我很难用 postgres 设置 django。 这是我的设置.py: DATABASES = { 'default': { 'ENGINE': 'django.db.back
当我尝试从实时实例服务器访问数据库时出现此错误。有谁知道原因吗? 最佳答案 可能是你的硬盘没有可用空间 关于PostgreSQL:致命:XX000:无法写入初始化文件,我们在Stack Overflo
我正在尝试连接到我的 PostgreSQL 服务器,但 psql 提示我没有有效的客户端证书。以下是我创建证书的方式: 自签名服务器证书: openssl req -new -text -nodes
我团队中的其他人创建了一个新的 git 分支,提交并推送到我们使用的常用远程。当我尝试检查这个分支时,我得到了这个: % git checkout 12382 fatal: Cannot switch
我正在尝试让 TravisCI 自动部署我的 Hakyll 静态站点,根据 this guide . 这是我的存储库的设置方式。我有我的源代码分支,其中包含我的 hakyll 和 Markdown 文
尝试提交时 git commit -a -m "Huge update" 我明白了 fatal: could not parse HEAD Error When Committing 看完fatal:
我想在我的 flutter 应用程序上使用 fcm,所以在创建 firebase 控制台并在我的 gradle 中安装了一些依赖项之后,如下所示: build.gradle:项目 dependenci
我是 GIT 的初学者,现在遇到了一个大问题。我在另一台 PC 上提交并推送了一些文件,现在在我的家用 PC 上,git 坏了。 请看下面: $ git status fatal: failed to
我想从 github 上克隆一个项目到我的电脑上 D:\Projects> git clone https://github.com/***/***.git 但是在下载的时候,出现了几个致命的错误:
所以我尝试使用以下命令获取opencv_contrib: $ git clone https://github.com/Itseez/opencv_contrib 这给了我以下错误: fatal: d
这是我在pod文件中使用的行 pod'SDWebImage','〜> 3.8' 以前是 pod'SDWebImage','〜> 3.7' 我尝试了以下 pod安装 pod更新和 pod更新'SDWeb
我是一名优秀的程序员,十分优秀!