title: Onclick image slider and redirect to website url
body: <p>I add a image slider (library by <a href="https://github.com/daimajia/AndroidImageSlider" rel="nofollow">Daimajia's AndroidImageSlider</a>) above my ListView. The image slider success to load the image from Drawable. What i want to do is : when click on the specific image, it will redirect me to a website url. Is there any possible way to do so? I tried " if(name == image_name) then Intent ", but its not working. Please Help me on this. Thanks.</p>
  
  <pre><code>public class HomeFragment extends Fragment implements BaseSliderView.OnSliderClickListener  {
  
       public static final String TAG_CATEGORY = "category";
  
       Button lifestyle, men, women, books, cars, furnitures, photography, music;
       String life;
  
       private SliderLayout mSlider;
  
  public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) {
  
      View rootView = inflater.inflate(R.layout.fragment_home,container,false);
  
      lifestyle = (Button) rootView.findViewById(R.id.button_lifestyle);
      men = (Button) rootView.findViewById(R.id.button_men);
      women = (Button) rootView.findViewById(R.id.button_women);
      books = (Button) rootView.findViewById(R.id.button_books);
      cars = (Button) rootView.findViewById(R.id.button_cars);
      furnitures = (Button) rootView.findViewById(R.id.button_furnitures);
      photography = (Button) rootView.findViewById(R.id.button_photography);
      music = (Button) rootView.findViewById(R.id.button_music);
  
      mSlider = (SliderLayout)rootView.findViewById(R.id.slider);
  
      //HashMap&lt;String,String&gt; url_maps = new HashMap&lt;String, String&gt;();
      //url_maps.put("Car", "http://gemini888.tk/GPFileUpload/uploads/car.jpg");
      //url_maps.put("Camera", "http://gemini888.tk/GPFileUpload/uploads/camera.jpg");
      //url_maps.put("Men", "http://gemini888.tk/GPFileUpload/uploads/men.jpg");
      //url_maps.put("Women", "http://gemini888.tk/GPFileUpload/uploads/women.jpg");
  
      HashMap&lt;String,Integer&gt; file_maps = new HashMap&lt;String, Integer&gt;();
      file_maps.put("Tourist Guide",R.drawable.tourist);
      file_maps.put("Local Food",R.drawable.food);
      file_maps.put("Penang Art",R.drawable.penang);
      file_maps.put("Puchong Food", R.drawable.puchong);
  
  
      Drawable resTou = this.getResources().getDrawable(R.drawable.tourist);
      Drawable resFood = this.getResources().getDrawable(R.drawable.food);
      Drawable resPen = this.getResources().getDrawable(R.drawable.penang);
      Drawable resPuc = this.getResources().getDrawable(R.drawable.puchong);
  
  
  
  
      for(String name : file_maps.keySet()){
          TextSliderView textSliderView = new TextSliderView(getActivity());
          // initialize a SliderLayout
          textSliderView
                  .description(name)
                  .image(file_maps.get(name))
                  .setScaleType(BaseSliderView.ScaleType.Fit)
                  .setOnSliderClickListener(this);
  
          //add your extra information
          textSliderView.getBundle().putString("extra",name);
  
         mSlider.addSlider(textSliderView);
      }
      mSlider.setPresetTransformer(SliderLayout.Transformer.Accordion);
      mSlider.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
      mSlider.setCustomAnimation(new DescriptionAnimation());
      mSlider.setDuration(4000);
  
  
  
  
      lifestyle.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View rootView) {
  
  
              Intent a = new Intent(getActivity(), Category_product.class);
              startActivity(a);
  
          }
      });
  
      men.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View rootView) {
  
              Intent b = new Intent(getActivity(), Men_product.class);
              startActivity(b);
  
      }
      });
  
      women.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View rootView) {
  
              Intent b = new Intent(getActivity(), Women_product.class);
              startActivity(b);
  
      }
      });
  
      books.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View rootView) {
  
              Intent b = new Intent(getActivity(), Books_product.class);
              startActivity(b);
  
      }
      });
  
      cars.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View rootView) {
  
              Intent b = new Intent(getActivity(), Cars_product.class);
              startActivity(b);
  
      }
      });
  
      furnitures.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View rootView) {
  
              Intent b = new Intent(getActivity(), Furnitures_product.class);
              startActivity(b);
  
      }
      });
  
      photography.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View rootView) {
  
              Intent b = new Intent(getActivity(), Photography_product.class);
              startActivity(b);
  
      }
      });
  
      music.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View rootView) {
  
              Intent b = new Intent(getActivity(), Music_product.class);
              startActivity(b);
  
      }
      });
  
  
      return rootView;
  }
  
  @Override
  public void onSliderClick(BaseSliderView slider) {
      // TODO Auto-generated method stub
  
      //Intent touristIntent = new Intent("android.intent.action.VIEW",Uri.parse("http://m.mygp.la/mr/m.aspx?m=MelakaTouristGuide"));
      //Intent touristIntent = new Intent(getActivity(),AllProductActivity.class);
      //startActivity(touristIntent);
  
  
  
  }
  </code></pre>
  
  <p>}</p>