Displaying different View after selecting one item in GridView android
<p>I want to display different <code>Views</code> of <code>Activity</code> everytime I click on one item of <code>GridView</code>.
The <code>GridView</code> and the <code>View</code> is dynamic as I am getting the data from database.</p>

<p>Before that I successfully make different <code>ListView</code> after picking one item in <code>Spinner</code>. But it is in the same <code>Activity</code>. So how to implement my problem above. </p>

<p>This is my code :</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.user_menu_kategori);

    initWidget();
    readDB();
}

void initWidget() {

    gridKategori = (GridView) findViewById(R.id.myGrid);

    goBack = (Button) findViewById(R.id.btnGoBack);
    goBack.setOnClickListener(this);

}

void readDB() {
    helper = new BiutisDbHelper(this);
    database = helper.getWritableDatabase();

    util = new Utils(this);


        currentData = new ArrayList&lt;DetailsKategori&gt;();
        // ---- load data ----
        currentData = util.loadDataKategori();

        adapter = new KategoriImageAdapter(this, currentData);
        gridKategori.setAdapter(adapter);
        gridKategori.setOnItemClickListener(MenuAyoBelajar.this);

    }
}

@Override
public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position,
        long id) {
    // TODO Auto-generated method stub

    Intent goItem = new Intent(MenuAyoBelajar.this, ItemDengarkan.class);
    startActivity(goItem);
}
</code></pre>

<p>Next Activity :</p>

<pre><code>    @Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.user_view_item);

    helper = new BiutisDbHelper(this);
    database = helper.getReadableDatabase();

    imgKG = (ImageView) findViewById(R.id.imgKG);
    imgKG.setOnClickListener(this);

    switcherTextItem = (TextSwitcher) findViewById(R.id.switcherTextItem);
    switcherImageItem = (ImageSwitcher) findViewById(R.id.switcherImageItem);

        database.close();

    }
}
</code></pre>

<p>Any help would be appreciated..</p>
