protected void onCreate(Bundle savedInstanceState) {
        int d1 =0;
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);

        Button button2 = (Button) findViewById(R.id.button_2);
        button2.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                Bundle bd = new Bundle();
                bd.putString("Extr" , "Hello! FirstActivity");
                intent.putExtras(bd);
                setResult(1 , intent);
                finish();
            }
        });
    }