Skip to content
Permalink
e8b09da827
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
32 lines (27 sloc) 1.05 KB
package com.mobile.emvpay;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
if (intent != null && Intent.ACTION_VIEW.equals(intent.getAction())) {
setContentView(R.layout.activity_checkout);
Uri data = intent.getData();
if (data != null) {
Button payButton = findViewById(R.id.pay_now_button);
payButton.setOnClickListener(view -> {
Intent paymentActivityIntent = new Intent(intent);
paymentActivityIntent.setClass(MainActivity.this, PaymentActivity.class);
startActivity(paymentActivityIntent);
});
}
}else{
setContentView(R.layout.activity_main);
}
}
}