Answer the question
In order to leave comments, you need to log in
What's wrong with passing a string between activities?
I'm trying to send a string from one activity
Intent intent = new Intent(LoginActivity.this, MyPageActivity.class);
Bundle bundle = new Bundle();
bundle.putString("headers", html_value);
intent.putExtras(bundle);
startActivity(intent);
String headers2 = getIntent().getExtras().getString("headers");
TextView outputView = (TextView) findViewById(R.id.responseView);
outputView.setText(headers2);
Answer the question
In order to leave comments, you need to log in
It worked like this
Bundle bundle = new Bundle();
bundle.putString("headers", Headers);
Intent intent = new Intent(LoginActivity.this, MyPageActivity.class);
intent.putExtras(bundle);
startActivity(intent);
Bundle bundle=getIntent().getExtras();
String headers2 = bundle.getString("headers");
TextView outputView = (TextView) findViewById(R.id.responseView);
outputView.setText(headers2);
Find the difference from my code?
startActivity(new Intent(getActivity().getApplicationContext(), DetailActivity.class)
.putExtra(DetailActivity.INTENT_PRODUCT, product));
mProduct = getIntent().getParcelableExtra(INTENT_PRODUCT);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question