I am integrating PayU Payment gateway in My Xamarin forms application. So I have converted all the given Libraries using Xamarin Binding Libs. I am getting this erron when click on pay Button
Java.Lang.RuntimeException: 'Unable to start activity ComponentInfo{com.optimiserfood.bakers_lounge/com.payu.custombrowser.CBActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.'
However I have seen that CBActivity Using AppCompatActivity on decomplinig the library. it is also works fine with android studio.
In this case, you can try to change the Java inheritance from
AppCompatActivity
toActivity
.The general rule is that if you want your code to support older versions of Android, it should have the
AppCompat
theme and the java code should extendAppCompatActivity
. If you have an activity that doesn't need this support, such as you only care about the latest versions and features of Android, you can apply any theme to it but the java code must extend plain old Activity.NOTE:
When changing from
AppCompatActivity
(or a subclass, ActionBarActivity), to Activity, we should also change the various calls withsupport
to the corresponding call withoutsupport
. For example, instead of usinggetSupportFragmentManager
,we should usegetFragmentManager
.Another option is to use following style in style resource: