66 lines
2.2 KiB
Java
66 lines
2.2 KiB
Java
package monnethic.mobile.transaction;
|
|
|
|
import android.content.Intent;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.widget.Button;
|
|
import android.widget.EditText;
|
|
import android.widget.Toast;
|
|
|
|
import com.example.monnthic.monnethicmobile.R;
|
|
|
|
import monnethic.mobile.qrcode.QrCodeActivity;
|
|
|
|
public class ReceivePayementActivity extends AppCompatActivity {
|
|
Button cancelButton;
|
|
Button validateButton;
|
|
EditText amountValueEdit;
|
|
|
|
private String user_hash;
|
|
private String user_password;
|
|
private String session_id;
|
|
private String wallet_hash;
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_receive_payement);
|
|
cancelButton=findViewById(R.id.buttonCancel);
|
|
validateButton=findViewById(R.id.buttonValidate);
|
|
amountValueEdit=findViewById(R.id.amountValue);
|
|
|
|
Intent intent = getIntent();
|
|
user_hash = intent.getStringExtra("USER_HASH");
|
|
user_password = intent.getStringExtra("USER_PWD");
|
|
session_id = intent.getStringExtra("SESSION_ID");
|
|
wallet_hash = intent.getStringExtra("WALLET_HASH");
|
|
|
|
cancelButton.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
public void onClick(View view) {
|
|
finish();
|
|
}
|
|
});
|
|
validateButton.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
public void onClick(View view) {
|
|
generateQrCodeWithValue(amountValueEdit.getText().toString());
|
|
}
|
|
});
|
|
}
|
|
|
|
public void generateQrCodeWithValue(String amount){
|
|
Intent generateQrIntent = new Intent(ReceivePayementActivity.this, QrCodeActivity.class);
|
|
generateQrIntent.putExtra("WALLET_HASH",wallet_hash);
|
|
generateQrIntent.putExtra("AMOUNT",amount);
|
|
ReceivePayementActivity.this.startActivity(generateQrIntent);
|
|
}
|
|
|
|
@Override
|
|
protected void onStop() {
|
|
super.onStop(); // Always call the superclass method first
|
|
Toast.makeText(getApplicationContext(), "onStop called", Toast.LENGTH_LONG).show();
|
|
}
|
|
}
|