want to set listview after images

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

want to set listview after images

Postby hiteshrao » Tue May 27, 2008 4:20 pm

hi friends
hi sir
i want to set four images horizontally and when i clicked any of the
images then i want to display list component that contain
title ,image,and count for my application.
i have done coding for my application ,but in this i m facing one
problem.
the problem is when i click on image then the list component is
displayed but that list component is overwrite on that image.i want to
set that listcomponent below images. and this view is set by base
adapter class.
here is my code.plz suggest me any idea its very urgent.
thanks in advance.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. package com.umundo.screen;
  3.  
  4.  
  5.  
  6. import java.io.InputStream;
  7.  
  8. import java.net.URL;
  9.  
  10.  
  11.  
  12. import org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection;
  13.  
  14.  
  15.  
  16. import android.content.Context;
  17.  
  18. import android.graphics.Bitmap;
  19.  
  20. import android.graphics.BitmapFactory;
  21.  
  22. import android.graphics.Color;
  23.  
  24. import android.util.Log;
  25.  
  26. import android.widget.ImageView;
  27.  
  28. import android.widget.LinearLayout;
  29.  
  30. import android.widget.TextView;
  31.  
  32. import android.widget.LinearLayout.LayoutParams;
  33.  
  34.  
  35.  
  36. public class ChannelListView extends LinearLayout
  37.  
  38. {
  39.  
  40.         public Bitmap imageBitmap = null ;
  41.  
  42.  
  43.  
  44.         public ChannelListView(Context context,ChannelList channelList)
  45.  
  46.         {
  47.  
  48.                 super(context);
  49.  
  50.                 this .setOrientation(HORIZONTAL);
  51.  
  52.                
  53.  
  54.                 LinearLayout.LayoutParams imagePram = new LinearLayout.LayoutParams(50,LayoutParams.WRAP_CONTENT);
  55.  
  56.                 imagePram.setMargins(1,1,1,1);
  57.  
  58.                
  59.  
  60.                 ImageView image = new ImageView( context );
  61.  
  62.                 if(channelList.getImageResources() instanceof Integer)
  63.  
  64.                 {
  65.  
  66.                         int imageResource =(Integer) channelList.getImageResources();
  67.  
  68.                         image.setImageResource(imageResource);
  69.  
  70.                        
  71.  
  72.                 }
  73.  
  74.                 else
  75.  
  76.                 {
  77.  
  78.                         imageBitmap = (Bitmap)channelList.getImageResources();
  79.  
  80.                         image.setImageBitmap(imageBitmap);
  81.  
  82.                 }
  83.  
  84.                
  85.  
  86.                 addView(image, imagePram);
  87.  
  88.                
  89.  
  90.                 LinearLayout.LayoutParams titleParams = new LinearLayout.LayoutParams(100, LayoutParams.WRAP_CONTENT);
  91.  
  92.                 titleParams.setMargins(1, 1, 1, 1);
  93.  
  94.                
  95.  
  96.                 TextView textView = new TextView( context );
  97.  
  98.                 textView.setText(channelList.getTitle());
  99.  
  100.                 textView.setTextSize(17f);
  101.  
  102.                 textView.setTextColor(Color.WHITE);
  103.  
  104.                 addView( textView, titleParams);
  105.  
  106.                
  107.  
  108.                 LinearLayout.LayoutParams countParams = new LinearLayout.LayoutParams(100, LayoutParams.FILL_PARENT);
  109.  
  110.                 countParams.setMargins(1, 1, 1, 1);
  111.  
  112.                
  113.  
  114.                 TextView textCount = new TextView(context);
  115.  
  116.                 textCount.setText(channelList.getViewCount());
  117.  
  118.                 textCount.setTextSize( 17f );
  119.  
  120.                 textCount.setTextColor(Color.GREEN);
  121.  
  122.         addView( textCount, countParams);
  123.  
  124.                
  125.  
  126.         }
  127.  
  128.        
  129.  
  130.        
  131.  
  132.        
  133.  
  134.  
  135.  
  136. }
Parsed in 0.038 seconds, using GeSHi 1.0.8.4
hiteshrao
Freshman
Freshman
 
Posts: 9
Joined: Thu May 22, 2008 7:49 pm

Top

sir here is my screen shots

Postby hiteshrao » Tue May 27, 2008 4:27 pm

[img]d:traineeapplication.png[/img]
after coming list component my view is seen as follow:
[img]d:traineeapplication2.png[/img]
hiteshrao
Freshman
Freshman
 
Posts: 9
Joined: Thu May 22, 2008 7:49 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google Feedfetcher and 3 guests