Note that there are some explanatory texts on larger screens.

plurals
  1. POClick images of carousel view
    primarykey
    data
    text
    <p>I created the app. which is displaying the images in carousel view. I want to click the images of the carousel view &amp; go to the web site. </p> <p>How to do it. I load the images as following way into my carousel view.]</p> <pre><code>public class LazyAdapter extends BaseAdapter { private Activity activity; private String[] data; private static LayoutInflater inflater=null; String dirUrl[]; public ImageLoader imageLoader; public ViewGroup carousel; HorizontalCarouselLayout carousel_layout_event; int widthScreen,heightScreen; public LazyAdapter(Activity a, String[] d) { activity = a; data=d; inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); imageLoader=new ImageLoader(activity.getApplicationContext()); } public int getCount() { return data.length; } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public void getDimensionScreen(int width,int height){ widthScreen=width; heightScreen=height; } public View getView(int position, View convertView, ViewGroup parent) { View vi=convertView; if(convertView==null) vi = inflater.inflate(R.layout.showsmain, null); ImageView image=(ImageView)vi.findViewById(R.id.imageView1); imageLoader.DisplayImage(data[position], image); int width = Double.valueOf(widthScreen*1.4).intValue(); int height = Double.valueOf(heightScreen*1.2).intValue(); imageLoader.getDimension(width, height); return vi; } } </code></pre> <p>the layout of image view is,</p> <pre><code> &lt;ImageView android:id="@+id/imageView1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:scaleType="fitXY" android:layout_alignParentTop="true" /&gt; </code></pre> <p>My carousel layout xml file is,</p> <pre><code>&lt;com.touchmenotapps.carousel.simple.HorizontalCarouselLayout android:id="@+id/carousel_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@+id/relativeLayout1" android:layout_marginTop="@dimen/marginTopUserImagePlayeractivity" &gt; &lt;/com.touchmenotapps.carousel.simple.HorizontalCarouselLayout&gt; </code></pre> <p>pls give me answers immediately, I'm stuck of this question.</p> <p>Thanks.........</p> <p>here I set the carousel adapter in my mainactivity as following way,</p> <pre><code>public void displayHomeScreen(View v) { inflatedView.setVisibility(View.INVISIBLE); footerlayout.setVisibility(View.VISIBLE); headerlayout.setVisibility(View.VISIBLE); carousel_layout.setVisibility(View.INVISIBLE); progressbar.setVisibility(View.VISIBLE); layout.setVisibility(View.VISIBLE); clickCountHome = clickCountHome + 1; ((ViewGroup) carousel_layout_home).removeAllViews(); UIStateManager.getInsatance().homeClickedUIChange(); RelativeLayout rLayout = (RelativeLayout) findViewById(R.id.relLayoutPlayerActivity); Resources res = getResources(); // resource handle Drawable drawable = res.getDrawable(R.drawable.loggedinscreen); rLayout.setBackgroundDrawable(drawable); if (clickCountHome &gt;= 1 &amp;&amp; xmlHome != null) { new CountDownTimer(1000, 1000) { @Override public void onTick(long millisUntilFinished) { } @Override public void onFinish() { progressbar.setVisibility(View.INVISIBLE); layout.setVisibility(View.INVISIBLE); } }.start(); carousel_layout_home.setStyle(mStyle); carousel_layout_home.setAdapter(adapterHome); carousel_layout_home .setOnCarouselViewChangedListener(new CarouselInterface() { @Override public void onItemChangedListener(View v, int position) { positionHome = position; v.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); myWebLink.setData(Uri.parse(dirHome[0])); startActivity(myWebLink); return false; } }); } }); </code></pre> <p>Here I get the urls as dirHome by parsing xml.......</p> <p>can you give the answer. I did above thing. but it didn't work perfectly............</p>
    singulars
    1. This table or related slice is empty.
    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.
    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