';com.example.volleyexample.app.AppController';不可分配给';android.app.Activity';
我不知道为什么会出现这个错误 哪里缺少添加一些代码或删除代码 我将尝试处理JSon对象请求 我将学习两门课程';com.example.volleyexample.app.AppController';不可分配给';android.app.Activity';,android,xml,android-manifest,Android,Xml,Android Manifest,我不知道为什么会出现这个错误 哪里缺少添加一些代码或删除代码 我将尝试处理JSon对象请求 我将学习两门课程AppController和lrubitmpcache Manifest.xml的屏幕截图: activity_main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res
AppController
和lrubitmpcache
Manifest.xml的屏幕截图
:
activity_main.xml:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
提前感谢:)您必须在活动名称中添加正确的程序包名称
<activity android:name="yourPackageName.ActivityName
实现活动的类的名称,是的子类
活动。属性值应该是完全限定的类名
(例如,“com.example.project.课外活动”)。但是,
如果名称的第一个字符是句点(用于
例如,“.ExtercurialActivity”),它被附加到包中
元素中指定的名称
您应该在活动名中添加适当的包名
<activity android:name="yourPackageName.ActivityName
然后,
清除重建运行
它应该在清单的应用程序标记中。像下面这样
<activity android:name="yourPackageName.ActivityName
<application
android:name=".yourPackage.AppController"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
// Your activities, services... declared here
</application>
//您的活动、服务。。。在此声明
您的包名是什么?在主活动中,我的包名:com.example.volleyexample代码>@UmairIs AppController您的活动名称?它看起来像是应用程序的名称它可能是一个java类,但它扩展了哪个类?@IntelliJAmiya ya我会检查你的答案:)非常感谢你给我的回复。。它应该对我有用。。