60 lines
1.8 KiB
Java
60 lines
1.8 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 java.math.BigInteger;
|
|
|
|
public class TransactionActivity extends AppCompatActivity {
|
|
private String address;
|
|
private EditText addressDestination;
|
|
private EditText amount;
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_transaction);
|
|
addressDestination = findViewById(R.id.destination_address);
|
|
amount = findViewById(R.id.amount);
|
|
Button buttonCancel = findViewById(R.id.btn_cancel);
|
|
Button buttonOk = findViewById(R.id.btn_send);
|
|
|
|
Intent intent = getIntent();
|
|
address = intent.getStringExtra("WALLET_ADDRESS");
|
|
|
|
buttonCancel.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
public void onClick(View view) {
|
|
finish();
|
|
}
|
|
});
|
|
|
|
buttonOk.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
public void onClick(View view) {
|
|
sendTransaction();
|
|
}
|
|
});
|
|
}
|
|
|
|
public void sendTransaction(){
|
|
String adD = addressDestination.getText().toString();
|
|
BigInteger amt = new BigInteger(amount.getText().toString());
|
|
/*
|
|
if(AccessBlockchain.sendTransationTo(address, adD, amt)){
|
|
Toast.makeText(this, "OK.", Toast.LENGTH_SHORT).show();
|
|
}
|
|
*/
|
|
String message = "Comming soon, addressDestination "+adD+" Amount : "+amt.toString();
|
|
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
|
}
|
|
|
|
}
|