you should probably call removeView() :)) sorry, i could not help it :))

how about you just add the textview one time only?

or how about you just post your code?

BR,
Adrian Vintu

http://adrianvintu.com


On Sat, Mar 27, 2010 at 3:52 PM, rubeN_vl <rvanluch...@hotmail.com> wrote:

> Yeah, figured out that yet, if i do that it works if i push the button
> 1 time, the second time i push it the application just crashes.
> Logcat gives me this error: You must call removeView() on the childs
> parent first.
> I need some way to 'flush' the textview.
>
> On 27 mrt, 15:44, Adrian Vintu <adrianvi...@gmail.com> wrote:
> > Your code probably looks like this
> > AlertDialog a = builder.create();
> >
> > a.setButton(AlertDialog.BUTTON_POSITIVE, "Ok", new OnClickListener()
> > {
> >  public void onClick(DialogInterface dialog, int which)
> >  {
> >   TextView b = new TextView(this);
> >
> >    ...
> >
> > }
> >
> > You need to create the TextView outside the scope of the OnClickListener.
> > The "this" has to point to Context, which is your Activity.
> >
> > BR,
> > Adrian Vintu
> >
> > http://adrianvintu.com
> >
> > On Sat, Mar 27, 2010 at 3:28 PM, rubeN_vl <rvanluch...@hotmail.com>
> wrote:
> > > Hi,
> >
> > > i'm trying to create a new TextView when a button is clicked.
> > > TextView b = new TextView(this); isnt working cause 'this' refers to
> > > new View.onClickListener.
> > > Been searchin for hours, cant find a solution.
> >
> > > --
> > > 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%2bunsubscr...@googlegroups.com>
> <android-developers%2bunsubscr...@googlegroups.com<android-developers%252bunsubscr...@googlegroups.com>
> >
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
> >
> > > To unsubscribe from this group, send email to android-developers+
> > > unsubscribegooglegroups.com or reply to this email with the words
> "REMOVE
> > > ME" as the subject.
>
> --
> 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%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
> To unsubscribe from this group, send email to android-developers+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to