Skip to content

Commit 230144a

Browse files
cezannecAsser
authored andcommitted
TFragments.06-Exercise-CommunicateBetweenActivities
1 parent 0f437c0 commit 230144a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

app/src/main/java/com/example/android/android_me/ui/AndroidMeActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ protected void onCreate(Bundle savedInstanceState) {
3535
// Only create new fragments when there is no previously saved state
3636
if(savedInstanceState == null) {
3737

38+
// TODO (5) Retrieve list index values that were sent through an intent; use them to display the desired Android-Me body part image
39+
// Use setListindex(int index) to set the list index for all BodyPartFragments
40+
3841
// Create a new head BodyPartFragment
3942
BodyPartFragment headFragment = new BodyPartFragment();
4043

app/src/main/java/com/example/android/android_me/ui/MainActivity.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ protected void onCreate(Bundle savedInstanceState) {
3838
public void onImageSelected(int position) {
3939
// Create a Toast that displays the position that was clicked
4040
Toast.makeText(this, "Position clicked = " + position, Toast.LENGTH_SHORT).show();
41+
42+
// TODO (2) Based on where a user has clicked, store the selected list index for the head, body, and leg BodyPartFragments
43+
44+
// TODO (3) Put this information in a Bundle and attach it to an Intent that will launch an AndroidMeActivity
45+
46+
// TODO (4) Get a reference to the "Next" button and launch the intent when this button is clicked
47+
4148
}
4249

4350
}

app/src/main/res/layout/fragment_master_list.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
limitations under the License.-->
1212

1313
<!-- GridView that displays AndroidMe images -->
14+
<!-- TODO (1) Turn this into a LinearLayout and add a "Next" button at the bottom of the gridview -->
1415
<GridView
1516
xmlns:android="http://schemas.android.com/apk/res/android"
1617
android:id="@+id/images_grid_view"

0 commit comments

Comments
 (0)