Coder Social home page Coder Social logo

Comments (9)

nuxzero avatar nuxzero commented on June 24, 2024 1

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.

nuxzero avatar nuxzero commented on June 24, 2024

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.

annchar avatar annchar commented on June 24, 2024
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.

annchar avatar annchar commented on June 24, 2024

Call from activity extend AppCompatActivity
this project use androidX all file

from omise-android.

annchar avatar annchar commented on June 24, 2024
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.

nuxzero avatar nuxzero commented on June 24, 2024

Could you give us full stacktrace from the exception?

from omise-android.

annchar avatar annchar commented on June 24, 2024
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.

nuxzero avatar nuxzero commented on June 24, 2024

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.

annchar avatar annchar commented on June 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.