- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 android 和 java 编程的新手,我在我的应用程序中收到 ActivityNotFoundException。
这里是 Activity 被调用的仅有的两次:
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// TODO Auto-generated method stub
String selectedItem = (String) lvCheckLists.getItemAtPosition(position);
Intent i= new Intent("com.teamvdb.checklist.checkListActivity");
// Package name and activity
// Intent i= new Intent(MainActivity.this,SecondActivity.Class);
// Explicit intents
i.putExtra("selectedItem",selectedItem);
// Parameter 1 is the key
// Parameter 2 is your value
startActivity(i);
Intent openCheckListActivity = new ntent("com.teamvdb.checklist.checkListActivity");
startActivity(openCheckListActivity);
}
});
}
这是我的 Android list :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.teamvdb.checklist"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity android:name=".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=".checkListActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
我花了最后 20 分钟试图弄清楚它出了什么问题,但我看不到问题所在。是的,类(class)拼写正确。
最佳答案
显式启动 checkListActivity :
public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
String selectedItem = (String) lvCheckLists.getItemAtPosition(position);
Intent i= new Intent(MainActivity.this,checkListActivity.class);
i.putExtra("selectedItem",selectedItem);
startActivity(i);
});
checkListActivity 不需要 intent-filter,所以删除它并在 AndroidManifest.xml 中定义为简单:
<activity android:name=".checkListActivity"/>
注意:删除不必要的再次启动checkListActivity的代码。
关于安卓:ActivityNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27457473/
我是 android 和 java 编程的新手,我在我的应用程序中收到 ActivityNotFoundException。 这里是 Activity 被调用的仅有的两次: public void o
我正在使用 contacl 列表数据库应用程序,当我点击调用应用程序时,应用程序正在运行,但是当我点击列表中的发送电子邮件时,我收到以下错误: FATAL EXCEPTION: main an
我正在尝试创建一个非常简单的自定义 Intent 示例。我已经搜索过这个错误,但没有一个论坛有适合我的答案。这是我的文件: public class DemoImplicit extends Acti
我在以下代码中收到 ActivityNotFoundException: Main.java Intent intent = new Intent(); intent.setAction("
我想开始这样的 Activity : Intent intent = new Intent(this, FeedbackActivity.class); activity.startActivity(
对于存在并包含在我的应用程序 AndroidManifest.xml 中的 Activity ,我收到 ActivityNotFoundException。 这是我的场景: 我的应用程序项目包是:co
有时,当我尝试在应用程序中打开浏览器进行添加时,我的应用程序会崩溃,这是我的代码: public void onBannerClick(final View view){ Intent intent
首先,我使用的是 Eclipse IDE。我正在尝试制作一个应用程序商店。我不知道发生了什么,但它以前有效,现在我在 LogCat 中收到此错误。 02-02 13:26:39.750: E/Andr
此问题适用于显示网站图像和描述的应用程序,当单击 ListView 时,与该描述相关联的网站会在浏览器中打开。 但是当我点击其中一个时出现错误。我不知道如何解决它,我们将不胜感激。 这是错误堆栈: E
我正在向这样的广播接收器发送 Intent 。 Intent cpIntent = new Intent(); cpIntent.setClassName("com.android.contacts"
我正在使用出色的 ACRA 库来报告用户在我的应用测试版中遇到的任何错误。到目前为止,它显示的是一些用户在发送彩信时遇到问题,而大多数用户则没有。 特别是我发现使用 Droid Bionic 设备的用
我已经有几年没有做过异常处理了,我似乎无法弄清楚我做错了什么。我有一个应用程序可以打开我的另一个应用程序,如果用户还没有其他应用程序,我希望当前应用程序重定向到 Play 商店。现在,如果未安装该应用
我注意到分析标记了一些错误: class android.content.ActivityNotFoundException Msg: android.app.Instrumentation.chec
在我的应用中,我需要使用startActivity来查看文件的内容,或者使用默认的应用程序来打开某个文件,但有时android系统可能没有安装需要的应用程序。 我的问题是如何处理这个异常。我想要干杯,
我编写了一段代码,允许用户通过电子邮件发送订单给供应商 [ShopOwner] 以及他们的个人和购物车商品详细信息,但在这里我得到了一个 错误:不幸的是应用已停止 Logcat: 01-30 17:5
public void onContacts(View v) { Intent i=new Intent(Intent.ACTION_VIEW, ContactsContract.Contac
我在尝试启动服务时遇到“找不到 Activity ”异常。我在 list 中注册了服务。添加我认为是相关代码和 LogCat。让我知道您是否需要查看更多内容。 01-29 17:41:51.440
我在尝试从另一个 Activity 中调用 Activity 时遇到此异常。完整的异常(exception)是 android.content.ActivityNotFoundException:Un
我正在使用 Android Studio 中的产品风格,并且遇到了一个问题......! 我在 build.gradle 文件中设置了两种产品风格 产品 flavor { pro {
我有这个链接代表 Reddit 上的一个子项目。我正在尝试使用自定义 intent-filter当用户单击链接时启动加载子项(例如 reddit.com/r/test )的 Activity 。 这是
我是一名优秀的程序员,十分优秀!