alexander.klimoff wrote:А переменная THIEF у вас прописана?
Да во второй активности прописана переменная вот листинг
package com.example.psannikov.myfouthproject;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
public class SecondActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
public final static String THIEF = "com.example.psannikov.myfouthproject";
public void onRadioCkick (View v) {
Intent answerInstent = new Intent();
switch (v.getId()) {
case R.id.radioDog:
answerInstent.putExtra(THIEF, "Сраный пес");
break;
case R.id.radioCrow:
answerInstent.putExtra(THIEF, "Чертова варона");
break;
case R.id.radioCat:
answerInstent.putExtra(THIEF, "Да ты гонишь");
break;
}
setResult(RESULT_OK,answerInstent);
finish();
}
});
}
}