how to fix: Main Activity doesn’t extend AppCompatActivity
once I open android studio and I found an error in main activty in some functions like “startActivity(intent) it gives an error: (cannot resolve method ‘startActivity’ in ‘mainActivity’)” and many others (my activity extend AppCompatActivity) and I run the app on my physical phone and also works fine without any runtime error. so I asked chatgpt and I tried build>clean project… build>rebuild project…. file>sync project with gradle files…. file>Invalidate caches but non of these works for me.once I make my activity extends Activity only so the project works fine but I can’t use themes and action bar and what I understand from that is AppCompatActivity doesn’t extend Activity also fragmentActivity (gradle and manifest and all activities works fine with no issues and all dependencies are okay)….. but when I created this project it was extend AppCompatActivity normally just like other projects…. so I think that there is a missing folder or its path is missing or someone moves this folder from its original path in the file explorer
how to fix: Main Activity doesn’t extend Activity
once I open android studio and I found an error in main activty in some functions like “startActivity(intent) it gives an error: (cannot resolve method ‘startActivity’ in ‘mainActivity’)” and many others (my activity extend AppCompatActivity) and I run the app on my physical phone and also works fine without any runtime error. so I asked chatgpt and I tried build>clean project… build>rebuild project…. file>sync project with gradle files…. file>Invalidate caches but non of these works for me.once I make my activity extends Activity only so the project works fine but I can’t use themes and action bar and what I understand from that is AppCompatActivity doesn’t extend Activity also fragmentActivity (gradle and manifest and all activities works fine with no issues and all dependencies are okay)….. but when I created this project it was extend AppCompatActivity normally just like other projects…. so I think that there is a missing folder or its path is missing or someone moves this folder from its original path in the file explorer