Hello

I am trying to pass some variables from a spinner to be displayed in
the following activity but whenever I do
variable.setText(String.valueOf(thing)); my app crashes.

This is my intent

Intent s= new Intent(NewCompetition.this,Target.class);
                s.putExtra("rounds",round);
                s.putExtra("attempts", attempt);
                s.putExtra("distance", distance);
                s.putExtra("tool", tool);

I have checked the status of these variables in the parent activity
and they display fine.

In the child activity...

public class Target extends Activity
{
    /** Called when the activity is first created. */

        private TextView name, attVal, scoreVal, attMax, roundVal, roundMax;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.target);

        Intent intent = this.getIntent();
        Bundle b = intent.getExtras();
        String rounds = b.getString("rounds");
        String shotround = b.getString("attempts");
        String distance = b.getString("distance");
        String firearm = b.getString("tool");
        //round.setText(String.valueOf(round));  The app crashes if I
include this line, I've tried it for all of the variables
   }

}

If anybody could offer ant advice it would be very much appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to