I'd expect the v.setId to not do what you want. I think it only sets
an id, doesn't set the layout for that view. I tried your example with
setContentView and it seems to work fine for me.

On Apr 9, 10:31 am, Rahul <[EMAIL PROTECTED]> wrote:
> i take it back. if i change v.setId to
> setContentView(R.layout.trackinfo) it still gets a null pointer.
> here is my R.layout.trackinfo
>
> <?xml version="1.0" encoding="UTF-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>                 android:layout_width="fill_parent"
>                 android:layout_height="fill_parent"
>                 android:orientation="vertical"
>                 android:padding="10dip">
>
>                 <TextView android:id="@+id/TitleLabel"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="Title:" />
>
>                 <TextView android:id="@+id/Title"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="" />
>
>                 <TextView android:id="@+id/CreatorLabel"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="Artist:" />
>
>                 <TextView android:id="@+id/Creator"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="" />
>                 <TextView android:id="@+id/AlbumLabel"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="Album:" />
>
>                 <TextView android:id="@+id/Album"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="" />
>                 <TextView android:id="@+id/GenreLabel"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="Genre:" />
>
>                 <TextView android:id="@+id/Genre"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="" />
>                 <TextView android:id="@+id/LocationLabel"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="Web Address:" />
>
>                 <TextView android:id="@+id/Location"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:text="" />
>
>                 <Button android:id="@+id/CloseButton"
>                         android:paddingTop="15dip"
>                         android:layout_width="fill_parent"
>                         android:layout_height="wrap_content"
>                         android:text="Close Window" />
>                 <Button android:id="@+id/DownloadButton"
>                         android:paddingTop="15dip"
>                         android:layout_width="fill_parent"
>                         android:layout_height="wrap_content"
>                         android:text="Download" />
> </LinearLayout>
>
> On Apr 9, 12:28 pm, Rahul <[EMAIL PROTECTED]> wrote:
>
> > i am getting null pointer exceptions when i am trying to run this
> > method.
> > it gets errors at the title.setText(currenttrack.getTitle()); line
> > because title was set as null. i dont see what happend, and when i set
> > content view it ruins the popup things behind it. what can i go about
> > doing?
>
> > public void popuptrack(View v, SeeqPodTrack currenttrack){
> >                 v.setId(R.layout.trackinfo);
>
> >                 TextView title = (TextView)findViewById(R.id.Title);
> >                 title.setText(currenttrack.getTitle());
> >                 TextView creator = (TextView)findViewById(R.id.Creator);
> >                 creator.setText(currenttrack.getCreator());
> >                 TextView album = (TextView)findViewById(R.id.Album);
> >                 album.setText(currenttrack.getAlbum());
> >                 TextView genre = (TextView)findViewById(R.id.Genre);
> >                 genre.setText(currenttrack.getGenre());
> >                 TextView location = (TextView)findViewById(R.id.Location);
> >                 location.setText(currenttrack.getLocation());
>
> >                 PopupWindow pw = new
> > PopupWindow(getViewInflate().inflate(R.layout.trackinfo, null, null));
> >                 pw.setHeight(320);
> >                 pw.setWidth(200);
> >                 pw.setBackground(v.getBackground());
> >                 pw.setFocusable(false);
> >                 pw.show(v);
> >                 pw.update(0, 50, -1, -1);
> >     }
--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to