Hello, I'm working with the following code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_conversor);
String t = Double.toString(getIntent().getExtras().getDouble("ask"));
}
The string t is a data that I get from another activity through the code:
Intent intent = new Intent(Tela1.this, conversor.class);
intent.putExtra("ask",ask);
startActivity(intent);
The problem is the following I can only display the value t if it is inside the "protected void onCreate" it only works inside, as serial to get the value out?