@@ -0,0 +1,3351 @@
+package com.example.w0143446.anotherfragmenttest;%0A%0A//import android.support.v4.app.Fragment;%0A//import android.support.v4.app.ListFragment;%0Aimport android.content.Intent;%0Aimport android.content.SharedPreferences;%0Aimport android.support.v4.app.FragmentManager;%0Aimport android.support.v4.app.FragmentTransaction;%0Aimport android.support.v7.app.AppCompatActivity;%0Aimport android.os.Bundle;%0Aimport android.view.View;%0Aimport android.widget.Toast;%0A%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0A%0Apublic class MainActivity extends AppCompatActivity implements myListFragment.OnImageSelectedListener %7B%0A%0A    //shared preferences stuff%0A    //public static final String IMAGE_VIEWED_PREFS = %22ImagesViewed%22;%0A    //public SharedPreferences settings;%0A%0A    myListFragment mylistFragment;%0A    ImageFragment myimgFragment;%0A%0A    FragmentManager fragmentManager;%0A    FragmentTransaction fragmentTransaction;%0A%0A    // Whether or not we are in dual-pane mode%0A    boolean isDualPane = false;%0A%0A    //image currently being displayed%0A    int imgIndex = 0;%0A%0A%0A    @Override%0A    public void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        setContentView(R.layout.activity_main);%0A%0A        // Restore preferences%0A        //settings = getPreferences(MODE_PRIVATE); //0 = private%0A        //populate viewedImgSet with existing values from shared prefs%0A        //Set%3CString%3E viewedImgSet = settings.getStringSet(IMAGE_VIEWED_PREFS, new HashSet%3CString%3E()); //if there isn't already a property set, leave null?%0A        //System.out.println(%22Loaded Shared Settings. there are: %22 + viewedImgSet.size() + %22 viewd imgs%22);%0A%0A        //find our fragments%0A        mylistFragment = (myListFragment) getSupportFragmentManager().findFragmentById(%0A                R.id.list);%0A        myimgFragment = (ImageFragment) getSupportFragmentManager().findFragmentById(%0A                R.id.tvNote);%0A        // determine whether we are in single or dual pane%0A        View imageView = findViewById(R.id.image);%0A        isDualPane = imageView != null && imageView.getVisibility() == View.VISIBLE;%0A%0A        //register ourselves as the listener for list fragment%0A        mylistFragment.setOnImageSelectedListener(this);%0A%0A        fragmentManager = getSupportFragmentManager();%0A        fragmentTransaction = fragmentManager.beginTransaction();%0A    %7D%0A%0A    //called when an image is selected%0A    @Override%0A    public void onImageSelected(int index) %7B%0A%0A        if (!mylistFragment.adapter.isEnabled(index)) %7B //ignore disabled buttons%0A            return;%0A        %7D%0A        Toast.makeText(MainActivity.this, %22You Clicked at %22 + index, Toast.LENGTH_SHORT).show();%0A        //create a new intent, pass image, send intent%0A        //Intent myIntent = new Intent(MainActivity.this, FullscreenActivity.class);%0A%0A        //myIntent.putExtra(%22web%22, web%5B+ position%5D);%0A        //System.out.println(getResources(imageId%5B+ position%5D));%0A        //myIntent.putExtra(%22image%22, (Integer) imageId%5Bposition%5D);%0A%0A        mylistFragment.adapter.setItemEnabled(index, false);%0A%0A        System.out.println(%22Here is the numbers%22);%0A        for (int i=0;i%3C 8; i++)%7B%0A            if (mylistFragment.adapter.isEnabled(i))%7B%0A                System.out.println(i);%0A            %7D%0A        %7D%0A        //startActivity(myIntent); //no result expected back%0A        myimgFragment.setText(%22Changed %22 + index);%0A%0A    %7D%0A%0A%7D%0A

Create MainActivity.java