0
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 datum taken 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 serie to get the value outside?