每次加载某个活动时,我的应用程序都会崩溃,因为它没有错误。这个问题发生在manifest.xml中,因为它一直说存在这个错误。
<activity android:name=".Fragment.MyAccountFragment"></activity>突出显示的反馈是:MyAccountFragment必须扩展Android应用程序活动
这是活动页面的摘录:
class MyAccountFragment : Fragment() {
private val RC_SELECT_IMAGE = 2
private lateinit var selectedImageBytes: ByteArray
private var pictureJustChanged = false
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.activity_my_account_fragment, container, false)发布于 2020-07-27 20:54:56
类文件的头显示它是Fragment而不是Activity。
类MyAccountFragment :片段()
根本不需要在清单中声明片段,所以您只需从清单中删除这一行:
https://stackoverflow.com/questions/63122960
复制相似问题