0

I am using preference in kotlin to create a setting for my app and able to design everything perfectly but when I put intent in it to move to other screen app is getting close again and again. This is my code if anyone know what mistake I am doing then it will be very helpful.

enter code here

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <Preference
        app:defaultValue="true"
        app:icon="@drawable/blore_image"
        app:key="profile_image"
        app:summary="@string/profile_summary"
        app:title="@string/profile">

        <intent
            android:targetPackage="com.ebookfrenzy.reminder.setting"
            android:targetClass="com.ebookfrenzy.reminder.setting.ProfileImage"/>

    </Preference>
</PreferenceScreen>

Shubham Tater
  • 3,718
  • 2
  • 13
  • 10
  • Use Logcat to examine the stack trace associated with your crash: https://stackoverflow.com/questions/23353173/unfortunately-myapp-has-stopped-how-can-i-solve-this – CommonsWare May 10 '20 at 13:24
  • android.content.ActivityNotFoundException: Unable to find explicit activity class {com.ebookfrenzy.reminder.setting/com.ebookfrenzy.reminder.setting.ProfileImage}; have you declared this activity in your AndroidManifest.xml? – Shubham Tater May 10 '20 at 15:18
  • ProfileImage is a fragment. Dose it mean it can call only a activity – Shubham Tater May 10 '20 at 15:19
  • "ProfileImage is a fragment" -- then you cannot show it via `startActivity()`. – CommonsWare May 10 '20 at 15:24
  • Do you have any program where you can see how it works...? – Shubham Tater May 10 '20 at 16:31

0 Answers0