UPDATED my code..

I would like to remove an Item from my GridView ( Main activity ) when I click on the btn Button from the ( Day03 activity).

Here are my Activities :

public class Main extends Activity {

```
GridView gridView;
public static int deletePos;

static ArrayAdapter adapter;

static final String[] numbers = new String[] { "1", "2", "3", "4", "5",
        "6", "7" };
static final String[] activities = new String[] { "Day01", "Day02",
        "Day03", "Day04", "Day05", "Day06", "Day07" };

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.grid);

    gridView = (GridView) findViewById(R.id.grid1);

    adapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, numbers);

    gridView.setAdapter(adapter);

    gridView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                long arg3) {
            // TODO Auto-generated method stub

            String val = activities[arg2]; // arg2 is the index of item
            Class ourClass = null;
            try {
                ourClass = Class.forName("com.example.cahllenge." + val);
            } catch (ClassNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            Intent intent = new Intent(Main.this, ourClass);

            deletePos = arg2;
            adapter.notifyDataSetChanged();

            startActivity(intent);

        }
    });

}

```

and the Day03 activity 
 public class Day03 extends Activity {

```
Button btn;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    btn = (Button) findViewById(R.id.ok);

    btn.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            int deletePos = Main.deletePos;
            Main.adapter.remove(deletePos);
            Main.adapter.notifyDataSetChanged();

        }
    });
}

```