Problems Opening a Gallery through a Button in Android -


I'm working on an Android app for the past time. I have a button that has a list of buttons ... adding new activities ... One button is a gallery ..

On main activity, I have an onClick method to open a button:

  private zero init () {Button3 = (button) findViewById (R.id.button3); // Button button3.setOnClickListener (New View. OnClickListener) {@Override Public Zero onClick (see V) {Intent I = New Intent (v.getContext (), Scholarship class;); Initial Activity (i); End (); // Activity after main activity activity to be closed}}); // Link to scholarship page button 4 = (button) findViewById (R.id.button4); // button button4.setOnClickListener (New View.OnClickListener) {@Override Public Zero onClick (see v) {intent i = new intent (v.getContext), GalleryActivity.class); startActivity (i); finish ); // Start information activity after closed key activity}}); // link to gallery page}  

button 3 works fine ... but when I click on the button 4 "Unfortunately your app has stopped by" / P>

There is no error in gallery activity.

  package ie.gmit.project; Import android.support.v7.app.ActionBarActivity; Importroid.os.Bundle; Import android.widget.GridView; Activity of Public Category Gallery ActionBarActivity Expanded {@ Override Public Zero (Create Bundle Saved InstantState) {Super .onCreate (SavedInstanceState); SetContentView (R.layout.activity_gallery); Find Gridview Gridview = (Gridview) VVBIID (RIDGrid_View); GridView.setAdapter (New ImageAdapter (this)); Android: id = "@ + ID / grid_view" Android: layout_width = "fill_parent" Android:  

layout_height = "fill_parent" Android: numColumns = "auto_fit" android: columnWidth = "90dp" Android: horizontalSpacing = "10dp" Android: verticalSpacing = "10dp" Android: Gravity = "Center" Android: stretchMode = "columnWidth" & gt; & Lt; / GridView & gt;

I have set up an image adapter in a different category:

  package ie.gmit.project; Import android.content.Context; Import android.view.View; Import android.view.ViewGroup; Import android.widget.BaseAdapter; Import android.widget.GridView; Import android.widget.ImageView; Public Class IMAGEAdapter Bidderator {Private Context mContext; // Constructor for the class Public Imagator (reference C) {mContext = c; } Public int getCount () {return mThumbIds.length; } @OverWide Public Object Hot Itam (Ent state) {// TODO auto-generated method stub returns empty; } @ Override Public Long ITMID (Int Position) {// Tudo Auto-Generated Method Stub Return 0; } @ Override public view getView (int position, seeviewview, ViewGroup parent) {ImageView imageView; If (convertView == empty) {imageView = New ImageView (mContext); // set parameter imageView.setLayoutParams (new GridView.LayoutParams (85, 85)); ImageView.setScaleType (ImageView.ScaleType.CENTER_CROP); ImageView.setPadding (8, 8, 8, 8); } And {imageView = (ImageView) ConvertView; } ImageView.setImageResource (mTHhumbIds [status]); See return image; } Public Integer [] mThumbIds = {R.drawable.club0, R.drawable.club1, R.drawable.club2, R.drawable.club3, R.drawable.club4, R.drawable.club5, R.drawable.club6, R.drawable.club7}; }  

For some reason unknown to me, when I click on "gallery" ... and as far as I can see ... the project completely fails so I have really done it completely on a brick wall, I have no error ... and everything is going well. But the gallery ..

Any comment or input is appreciated by a lot of people.

Thank you.

EDIT: I checked the log cat and I can not see anything in the red color with the tag of AndroidRuntime


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -