Kumar,
I have already checked your pages. Its shows example for drawable
which you have on mobile.
I want to load remote image. As remote image loading takes long time.
UI hangs up till the time.

I have also seen that you have written saying that we can pass null
and open new thread which downloads image to local.
Replace's the path to local file in html and then reset the text in
TextView.

This works fine when textview has one image but when our text has 2/3
img tags. Each time getter is called and 2/3 new threads get open and
2/3 times text is reset.
Lets imagine case where means while image downloads in new thread then
user goes to other activity and the one which we opened is destroyed.
Also the case where in same acitivty i have 2/3 pages like which has
next and prev button. So the image comes bit late and then the thread
will take other text and replace it somewhere else

I dont know but Im going it in big confusion. Is there some direct
widget for this ?

I dont want to use webview as I have some other things which gets
disturb because of webview. Need to it in textview only.


On Nov 17, 6:26 pm, Kumar Bibek <coomar....@gmail.com> wrote:
> http://techdroid.kbeanie.com/2010/06/textview-with-html-content.html
>
> On Nov 17, 6:17 pm, umakantpatil <umakantpat...@gmail.com> wrote:
>
>
>
>
>
>
>
> > No one in the form knows the answer ?
> > weired :(
>
> > On Nov 14, 10:38 pm, umakantpatil <umakantpat...@gmail.com> wrote:
>
> > > Thanks Kumar,
> > > I said it previous that i know i can load it async or in new thread.
> > > But after getting the image I don't know how to replace that image
> > > back in textview.
>
> > > Can you help me with small piece of code that how can i do it ?
>
> > > On Oct 27, 4:05 pm, Kumar Bibek <coomar....@gmail.com> wrote:
>
> > > > Do the fetching image part in a thread. That will solve your problem.
>
> > > > On Wed, Oct 27, 2010 at 4:25 PM, umakantpatil 
> > > > <umakantpat...@gmail.com>wrote:
>
> > > > > I have HTML text, I need to show it in textview. I did it. There are
> > > > > some images in it. I also made ImageGetter
> > > > > which loads image from remote server and displays it. But the issue is
> > > > > now its very slow.
> > > > > I know i can load it async. But i haven't got a single example or help
> > > > > for this.
>
> > > > > Below is the code to get the image
>
> > > > > �...@override
> > > > >                public Drawable getDrawable(String source) {
> > > > >                        Drawable drawable = null;
> > > > >                        Bitmap bitmap = null;
> > > > >                    InputStream in = null;
> > > > >                    BufferedOutputStream out = null;
> > > > >                    try {
> > > > >                            in = new BufferedInputStream(new
> > > > > URL(source).openStream(),4096);
> > > > >                        final ByteArrayOutputStream dataStream = new
> > > > > ByteArrayOutputStream();
> > > > >                        out = new BufferedOutputStream(dataStream, 
> > > > > 4096);
> > > > >                        copy(in, out);
> > > > >                        out.flush();
> > > > >                        final byte[] data = dataStream.toByteArray();
> > > > >                        bitmap = BitmapFactory.decodeByteArray(data, 0,
> > > > > data.length);
> > > > >                        drawable = new BitmapDrawable(bitmap);
>
> > > > >                            int width = getScreen();
> > > > >                            int fin = width - 120;
>
> > > > >                        drawable.setBounds(0, 0, fin, 200);
> > > > >                        return drawable;
> > > > >                    }catch (Throwable e) {
> > > > >                        return null;
> > > > >                }
> > > > > }
>
> > > > > Can any one tell my how can get it async without stopping UI?
>
> > > > > --
> > > > > 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<android-developers%2Bunsubs
> > > > >  cr...@googlegroups.com>
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/android-developers?hl=en
>
> > > > --
> > > > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com

-- 
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