java.lang.RuntimeException: Unable to start activity ComponentInfo{com.microsoft.pdfviewertestapplication/com.microsoft.pdfviewertestapplication.MainActivity}: java.lang.IllegalStateException: DialogFragment can not be attached to a container view

UnabletostartactivityComponentInfo{com.android.email/com.android.email2.ui.MailActivityEmail}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.microsoft.pdfviewertestapplication/com.microsoft.pdfviewertestapplication.MainActivity}: java.lang.IllegalStateException: DialogFragment can not be attached to a container view at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4077)