hi,

ok but for a count of 1 the getview is called almost 10 times.How to avoid
this??

On Fri, Feb 24, 2012 at 6:42 PM, luciofm <luci...@gmail.com> wrote:

> First of all, you should never do I/O (disk, networking) operations on
> getView() or your scrolling will be very sluggish, since they will run on
> the UI Thread an will block the scrolling until the request is fulfilled.
>
>
> LĂșcio Maciel
> luci...@gmail.com
>
>
> On Fri, Feb 24, 2012 at 10:19, vani reddy <vani.reddy.bl...@gmail.com>wrote:
>
>> Hey Check,
>>
>> @Override
>>     public View getView(final int position, View convertView, ViewGroup
>> parent) {
>>
>>         ViewHolder holder;
>>         if (convertView == null) {
>>             convertView = mInflater.inflate(R.layout.commentitem, null);
>>
>>             holder = new ViewHolder();
>>             holder.fbName = (TextView) convertView
>>                     .findViewById(R.id.reviewText);
>>             holder.fbName.setTypeface(fontObj_rockwell);
>>             holder.fbImage = (ImageView)
>> convertView.findViewById(R.id.fbImage);
>>
>>             convertView.setTag(holder);
>>         } else {
>>             holder = (ViewHolder) convertView.getTag();
>>         }
>>
>>         String profileFBURL = "http://graph.facebook.com/";
>>                 + m_Show.getFbids_watching().get(position) + "/picture";
>>         // Utility.setImageToImageView(profileFBURL, holder.fbImage);
>>
>>         holder.fbImage.setImageBitmap(model.getRoundedImage(profileFBURL,
>>                 profileFBURL, 10));
>>
>>         try {
>>             FriendInfo frndInfo = FacebookFriendAPIHandler
>>                     .getFacebookFriendInfo(m_Show.getFbids_watching().get(
>>                             position));
>>             holder.fbName.setText(frndInfo.getName());
>>         } catch (Exception e) {
>>
>>             e.printStackTrace();
>>         }
>>
>>
>>         convertView.setOnClickListener(new View.OnClickListener() {
>>
>>             @Override
>>             public void onClick(View v) {
>>
>>                 Intent intent =new
>> Intent(activity,UserProfileActivity.class);
>>                 Bundle bundle =new  Bundle();
>>
>> bundle.putString("fbID",String.valueOf(m_Show.getFbids_watching().get(position)));
>>                 bundle.putString("class", "wall");
>>                 intent.putExtras(bundle);
>>
>>                 View view1 = WallGroup.group
>>                         .getLocalActivityManager()
>>                         .startActivity(
>>                                 "UserProfileActivity",
>>
>> intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
>>                         .getDecorView();
>>
>>                 // Again, replace the view
>>                 WallGroup.group.replaceView(view1);
>>
>>
>>
>>             }
>>         });
>>         return convertView;
>>     }
>>
>>
>> --
>> Regards,
>> Vani Reddy
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Regards,
Vani Reddy

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to