Q: Get String from Fragment Consider this: 
MainActivity has a TextView id = txtMain;
Activity2 has a Fragment named Fragment1;
Fragment1 has a TextView id = txtFrag;
How can I get the String from fragment so appear at MainActivity?
I tried use a Bundle but wont work.

A: This is working code using Bundles, you may check your code for errors or post it here for review.
MainActivity.java
    String textViewText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);

        Bundle textBundle=getIntent().getExtras();
        textViewText=textBundle.get("TextView").toString();


    }

    @Override
    protected void onResume() {  // used onResume because until this call activity is created completely
        super.onResume();


        TextView textViewWidget=(TextView) findViewById(R.id.textView);
        textViewWidget.setText(textViewTexts);
    }

Fragment1.java
TextView text;

 @Override
    public View onCreateView(LayoutInflater inflater,
                             ViewGroup container, Bundle
                                     savedInstanceState) {

        // Inflate the layout for this fragment
        final View view =  inflater.inflate(R.layout.toolbar_fragment,
                container, false);

 Button newActivity=(Button) view.findViewById(R.id.new_activity_button);
        newActivity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                    text=(TextView) view.findViewById(R.id.txtFrag);

                    Intent newActivityIntent=new Intent(getActivity(),Main2Activity.class);
                    newActivityIntent.putExtra("TextView",text.getText());
                    startActivity(newActivityIntent);


            }
        });

}

