Comments (9)
From your code look correct to start AuthorizingPaymentActivity
. For now, I check from the project using AndroidX, but we cannot reproduce the exception. Would be great if you can give us for more information example Where do start Activity from Fragment or Activity? or create a project to reproduce the issue that will help us to investigate the issue.
from omise-android.
From what I see from the exception, AuthorizingPaymentActivity
didn't use AppCompatActivity
. I'm not sure how you start the activity.
Could you share the code that you use to start AuthorizingPaymentActivity
activity?
from omise-android.
fun showAuthorizingPaymentForm(activity: FragmentActivity, authorizeUri: String) {
val intent = Intent(activity, AuthorizingPaymentActivity::class.java)
intent.putExtra(AuthorizingPaymentActivity.EXTRA_AUTHORIZED_URLSTRING, authorizeUri)
intent.putExtra(AuthorizingPaymentActivity.EXTRA_EXPECTED_RETURN_URLSTRING_PATTERNS, arrayOf(BuildConfig.WEB_URL))
activity.startActivityForResult(intent, REQUEST_CODE_AUTHORIZING_PAYMENT)
}
from omise-android.
Call from activity extend AppCompatActivity
this project use androidX all file
from omise-android.
CheckoutActivity.kt
class CheckoutActivity : AppCompatActivity(){
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_checkout)
...
navigator.showAuthorizingPaymentForm(this, authorizedUri)
...
}
}
Navigator.kt
class Navigator(){
fun showAuthorizingPaymentForm(activity: FragmentActivity, authorizeUri: String) {
val intent = Intent(activity, AuthorizingPaymentActivity::class.java)
intent.putExtra(AuthorizingPaymentActivity.EXTRA_AUTHORIZED_URLSTRING, authorizeUri)
intent.putExtra(AuthorizingPaymentActivity.EXTRA_EXPECTED_RETURN_URLSTRING_PATTERNS, arrayOf(BuildConfig.WEB_URL))
activity.startActivityForResult(intent, REQUEST_CODE_AUTHORIZING_PAYMENT)
}
}
from omise-android.
Could you give us full stacktrace from the exception?
from omise-android.
2019-04-25 15:21:47.781 16196-16196/com.kpc.hisdev E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.kpc.hisdev, PID: 16196
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kpc.hisdev/co.omise.android.ui.AuthorizingPaymentActivity}: java.lang.ClassCastException: co.omise.android.ui.AuthorizingPaymentActivity cannot be cast to androidx.appcompat.app.AppCompatActivity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.ClassCastException: co.omise.android.ui.AuthorizingPaymentActivity cannot be cast to androidx.appcompat.app.AppCompatActivity
at com.smartlook.sdk.smartlook.analytics.c.b.f(SourceFile:150)
at com.smartlook.sdk.smartlook.analytics.c.b.a(SourceFile:146)
at com.smartlook.sdk.smartlook.analytics.c.b$1.onActivityStarted(SourceFile:92)
at android.app.Application.dispatchActivityStarted(Application.java:231)
at android.app.Activity.onStart(Activity.java:1270)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1256)
at android.app.Activity.performStart(Activity.java:6959)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2890)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
from omise-android.
We were trying to reproduce the issue with the information you provided, unfortunately we couldn't reproduce it. This issue might be caused by some configuration that we don't aware of.
We would like to help you solve this issue but we need your help. Could you provide a small project that can reproduce this issue? That will help us to investigate and find a solution quickly.
Thank you
from omise-android.
I found the cause of the problem It's because I installed a library called smart look.
Thank you for your help.
from omise-android.
Related Issues (20)
- Android Java Code HOT 4
- by when Prompt Pay support will be released? HOT 1
- Error adding credit card HOT 2
- Your Jackson dependency is vulnerable with high severity level HOT 2
- Could we have DomStorage enable from WebView in AuthorizingPaymentActivity? HOT 3
- As an Omise developer, I want to add a new source type in minimum places
- android.content.res.Resources$NotFoundException HOT 3
- The SDK caused Glide to fail to load HOT 5
- Testing information for authorize url
- Duplicate class error HOT 4
- Failed to integrate version 4.8.0 HOT 1
- Google Play warning: com.google.android.gms:play-services-ads 18.3.0 is outdated HOT 4
- App crash when trying input special character in ExpiryDateEditText HOT 2
- play-services-ads ,The SDK version has been reported as outdated.
- okhttp3.HttpUrl okhttp3.Request.url()' on a null object reference HOT 2
- bg_edit_text_outlined.xml Compilation error HOT 3
- Request to support screenshot and video recording prevention HOT 1
- Wrong CardBrand Identification HOT 1
- Fatal Exception: java.lang.StackOverflowError stack size 1037KB HOT 10
- Charge Class not found as you mention in Charge api HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from omise-android.