Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

need help

followed the instructions to the letter on the android programming class yet my code is riddled with errors. package com.madhatterstudio.interactivestory.ui;

import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView;

import com.madhatterstudio.interactivestory.R; import com.madhatterstudio.interactivestory.model.Story; import com.madhatterstudio.interactivestory.model.page;

public class StoryActivity extends AppCompatActivity {

private ImageView mImageView; private TextView mTextView; private Button mChoice1; private Button mChoice2; private String mName;

public static final String TAG = StoryActivity.class.getSimpleName(); private Story mStory = new Story(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_story); Intent intent = getIntent(); String mName = intent.getStringExtra(getString(R.string.key_name));

    if (mName == null){

        mName = "friend";
 }


   Log.d(TAG,mName);

mImageView = (ImageView)findViewById(R.id.StoryImageView); mTextView = (TextView)findViewById(R.id.StoryTextView); mChoice1 = (Button) findViewById(R.id.choicebutton1); mChoice2 = (Button) findViewById(R.id.choicebutton2); loadPage();

}

private void loadPage(){ page pagee = mStory.getPage(0);

Drawable drawable = getResources().getDrawable(page.getImageId());
mImageView.setImageDrawable(drawable);
String pageText = page.getText();
pageText = String.format(pageText, mName);
mTextView.setText(page.getText());
mChoice1.setText(page.getChoice1().getText());
mChoice2.setText(page.getChoice2().getText());

}

} I really want to learn android programming i love it and have tons of fun but i feel like i have no clue what I am doing i have to go to the forums a lot to get help what should i do i feel like giving up :(