Android Open Source - klarna-on-demand-android Main Activity






From Project

Back to project page klarna-on-demand-android.

License

The source code is released under:

Apache License

If you think the Android project klarna-on-demand-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.klarna.example;
/*w w  w .  j a va  2  s.  c  o  m*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.klarna.ondemand.Context;
import com.klarna.ondemand.RegistrationActivity;
import com.klarna.ondemand.WebViewActivity;


public class MainActivity extends Activity {

    public final int KLARNA_REGISTRATION_REQUEST_CODE = 1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        Context.setApiKey("test_d8324b98-97ce-4974-88de-eaab2fdf4f14");
    }

    public void openKlarnaRegistration(View view) {
        Intent intent = new Intent(this, RegistrationActivity.class);
        startActivityForResult(intent, KLARNA_REGISTRATION_REQUEST_CODE);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == KLARNA_REGISTRATION_REQUEST_CODE) {
            switch (resultCode) {
                case WebViewActivity.RESULT_CANCELED:
                    break;
                default:
                    break;
            }
        }
    }
}




Java Source Code List

com.klarna.example.ApplicationTest.java
com.klarna.example.MainActivity.java
com.klarna.ondemand.ContextTest.java
com.klarna.ondemand.Context.java
com.klarna.ondemand.RegistrationActivity.java
com.klarna.ondemand.UrlHelperTest.java
com.klarna.ondemand.UrlHelper.java
com.klarna.ondemand.WebViewActivity.java
com.klarna.ondemand.package-info.java