78 lines
2.9 KiB
Java
78 lines
2.9 KiB
Java
package monnethic.mobile.transaction;
|
|
|
|
import android.content.Intent;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
import android.os.Bundle;
|
|
import android.util.Log;
|
|
import android.view.View;
|
|
import android.widget.Button;
|
|
import android.widget.Toast;
|
|
|
|
import com.example.monnthic.monnethicmobile.R;
|
|
|
|
import monnethic.mobile.qrcode.QrCodeScannerActivity;
|
|
|
|
public class MakePayementActivity extends AppCompatActivity {
|
|
Button btnScanQr;
|
|
Button btnSendWithAddress;
|
|
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_make_payement);
|
|
|
|
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");
|
|
|
|
|
|
Log.i("UserAccountActivity", "user_hash : "+user_hash);
|
|
Log.i("UserAccountActivity", "user_password : "+user_password);
|
|
Log.i("UserAccountActivity", "session_id : "+session_id);
|
|
Log.i("UserAccountActivity", "wallet_hash : "+wallet_hash);
|
|
|
|
initViews();
|
|
}
|
|
|
|
private void initViews(){
|
|
btnScanQr = findViewById(R.id.buttonScanQr);
|
|
btnSendWithAddress = findViewById(R.id.buttonSendWithAddress);
|
|
|
|
btnScanQr.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
public void onClick(View view) {
|
|
Intent payementIntent = new Intent(MakePayementActivity.this, QrCodeScannerActivity.class);
|
|
payementIntent.putExtra("USER_HASH",user_hash);
|
|
payementIntent.putExtra("USER_PWD",user_password);
|
|
payementIntent.putExtra("WALLET_HASH",wallet_hash);
|
|
payementIntent.putExtra("SESSION_ID",session_id);
|
|
MakePayementActivity.this.startActivity(payementIntent);
|
|
}
|
|
});
|
|
|
|
btnSendWithAddress.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
public void onClick(View view) {
|
|
Intent payementIntent = new Intent(MakePayementActivity.this, TransactionActivity.class);
|
|
payementIntent.putExtra("USER_HASH",user_hash);
|
|
payementIntent.putExtra("USER_PWD",user_password);
|
|
payementIntent.putExtra("WALLET_HASH",wallet_hash);
|
|
payementIntent.putExtra("SESSION_ID",session_id);
|
|
MakePayementActivity.this.startActivity(payementIntent);
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override
|
|
protected void onStop() {
|
|
super.onStop(); // Always call the superclass method first
|
|
Toast.makeText(getApplicationContext(), "onStop called", Toast.LENGTH_LONG).show();
|
|
}
|
|
}
|