Note that there are some explanatory texts on larger screens.

plurals
  1. POI want the Images which are on the gridView should show in full View
    primarykey
    data
    text
    <p>Full Activity Class where the I want to display the Image in full Screen. I have all the images showing it in the gridView. I am not facing problem in that, however when I click on the image of the gridview it shows me the just the xml file which I have called. I guess I am doing wrong somewhere calling the id here in the FullImageAcitivity file. </p> <pre><code>public class FullImageActivity extends Activity { Button download, setas; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.full_image); setas = (Button) findViewById(R.id.setas); download = (Button)findViewById(R.id.download); final Intent i = getIntent(); final List&lt;Item&gt; items = new ArrayList&lt;Item&gt;(); final ImageAdapter imageAdapter = new ImageAdapter(this); ImageView imageView = (ImageView) findViewById(R.id.full_image_view); imageView.setImageResource(items.indexOf(i)); setas.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub WallpaperManager myWallpaperManager = WallpaperManager.getInstance(getApplicationContext()); try { myWallpaperManager.setResource(imageAdapter.items.indexOf(i)); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } } </code></pre> <p>here is my imageAdapter file.</p> <pre><code>public class ImageAdapter extends BaseAdapter { List&lt;Item&gt; items = new ArrayList&lt;Item&gt;(); private LayoutInflater inflater; public ImageAdapter(Context context) { inflater = LayoutInflater.from(context); items.add(new Item("One", R.drawable.abstact_one)); items.add(new Item("Two", R.drawable.abstract_three)); items.add(new Item("Three", R.drawable.image_two)); items.add(new Item("Four", R.drawable.image_four)); items.add(new Item("Five", R.drawable.image_five)); items.add(new Item("Six", R.drawable.image_nine)); items.add(new Item("Seven", R.drawable.image_ten)); } @Override public int getCount() { return items.size(); } @Override public Object getItem(int i) { return items.get(i); } @Override public long getItemId(int i) { return items.get(i).drawableId; } @Override public View getView(int i, View view, ViewGroup viewGroup) { View v = view; ImageView picture; TextView name; if(v == null) { v = inflater.inflate(R.layout.other, viewGroup, false); v.setTag(R.id.picture, v.findViewById(R.id.picture)); v.setTag(R.id.text, v.findViewById(R.id.text)); } picture = (ImageView)v.getTag(R.id.picture); name = (TextView)v.getTag(R.id.text); Item item = (Item)getItem(i); picture.setImageResource(item.drawableId); name.setText(item.name); return v; } private class Item { final String name; final int drawableId; Item(String name, int drawableId) { this.name = name; this.drawableId = drawableId; } } } </code></pre> <p>latestTab Activity File</p> <pre><code>public class LatestTab extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.latestphotos); GridView gridView = (GridView) findViewById(R.id.grid_view); // Instance of ImageAdapter Class gridView.setAdapter(new ImageAdapter(this)); /** * On Click event for Single Gridview Item * */ gridView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) { // Sending image id to FullScreenActivity Intent i = new Intent(getApplicationContext(), FullImageActivity.class); // passing array index i.putExtra("id", position); startActivity(i); } }); } } </code></pre> <p>full_image.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;RelativeLayout android:id="@+id/relshare" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:background="#79B8B8B8" &gt; &lt;Button android:id="@+id/setas" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginLeft="14dp" android:layout_toRightOf="@+id/share" android:gravity="right" android:text="Set As" android:textSize="25sp" /&gt; &lt;Button android:id="@+id/download" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_marginRight="34dp" android:text="Download" android:textSize="25sp" /&gt; &lt;/RelativeLayout&gt; &lt;ImageView android:id="@+id/full_image_view" android:layout_width="fill_parent" android:layout_height="fill_parent"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>latestphotos.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;GridView android:id="@+id/grid_view" android:layout_width="match_parent" android:layout_height="match_parent" android:verticalSpacing="0dp" android:horizontalSpacing="0dp" android:stretchMode="columnWidth" android:numColumns="2" /&gt; &lt;/FrameLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload