How to take the value in AppCompatActivity of Intenta??

How to take the value in AppCompatActivity of Intenta?
I run it like this:
Intent intent = new Intent(getActivity(), GG.class);
Bundle bundle = new Bundle();
bundle.putString("url", questionObject.getHref());
intent.putExtras(bundle);
startActivity(intent);

And take this:
String url = null;
 Bundle bundle = savedInstanceState;
 if (bundle!=null) url = bundle.getString("url", null);

But when I want to take the value of the parameter I gives null what's wrong??
June 14th 19 at 20:34
1 answer
June 14th 19 at 20:36
Solution
Bundle extras = getIntent().getExtras();
if (extras != null) {
 url = extras.getString("url", null);
}

savedInstanceState is used to restore the state of Activity after a configuration change, such as after a screen rotation.
Just found the same solution. Thank you - Damion.Howell commented on June 14th 19 at 20:39

Find more questions by tags Android