After invoking razorpay.submit() errors are logged with stackTrace
Tried to access visual service WindowManager from a non-visual Context:android.app.ContextImpl@9221b3d WindowManager should be accessed from Activity or other visual Context.
Use an Activity or a Context created with Context#createWindowContext(int, Bundle), which are adjusted to the configuration and visual bounds of an area on screen.
java.lang.IllegalAccessException: Tried to access visual service WindowManager from a non-visual Context:android.app.ContextImpl@9221b3d
at android.app.ContextImpl.getSystemService(ContextImpl.java:2251)
at android.content.ContextWrapper.getSystemService(ContextWrapper.java:944)
at com.razorpay.BaseUtils.getSystemService(BaseUtils.java:345)
at com.razorpay.J$_0_.a(Lumberjack.java:2100)
at com.razorpay.AnalyticsUtil.init(AnalyticsUtil.java:70)
at com.razorpay.AnalyticsUtil.setup(AnalyticsUtil.java:59)
at com.razorpay.BaseRazorpay.setup(BaseRazorpay.java:601)
at com.razorpay.Razorpay.submit(Razorpay.java:97)
at com.razorpay.Razorpay.submit(Razorpay.java:60)
This is happening because of
1Display var6 = ((WindowManager)BaseUtils.getSystemService(var14, "window")).getDefaultDisplay();
uses BaseUtils.getSystemService()
which always uses applicationContext
After invoking
razorpay.submit()
errors are logged with stackTraceThis is happening because of
1Display var6 = ((WindowManager)BaseUtils.getSystemService(var14, "window")).getDefaultDisplay();
usesBaseUtils.getSystemService()
which always uses applicationContext