I want to pass string value from activity to fragment. For that I\'m using bundle for transferring string value.
PUT STRING ACTIVITY Passing string
The savedInstance variable will be empty the first time you run your app, it only gets filled when the onSaveInstanceState method is called, this usually happens when you rotate the screen, then savedInstance variable will be populated. Try this :
if(savedInstance != null){
Log.d(TAG, "There's is something");
}else{
Log.d(TAG, "Nothing in there");
}
First time in logcat you will see the first message, try turning your device and the message in the else will show.
As @james said, the recommended way is to use interfaces, or have a field class but this increases coupling and destroys the whole point of fragments.