I am trying to get this popup window to pop up when it is called but
it keeps on getting a nullpointerexception error. it shows up at the
line whenever i try to use the setText method. When i debug it shows
that the popup window is not showable ever. the seeqpodtrack part is
working correctly for sure, so just ignore that part.

    public void popuptrack(View v, SeeqPodTrack currenttrack){
        int w = v.getWidth();
        int h = v.getHeight();
        final PopupWindow pw = new PopupWindow();
        pw.setWidth(w);
        pw.setHeight(h);
        pw.setContentView(findViewById(R.layout.trackinfo));

        pw.show(v);
        pw.update(v, -1, -1);
        TextView title = (TextView) findViewById(R.id.Title);
        TextView creator = (TextView) findViewById(R.id.Creator);
        TextView album = (TextView) findViewById(R.id.Album);
        TextView genre = (TextView) findViewById(R.id.Genre);
        TextView location = (TextView) findViewById(R.id.Location);
        title.setText(currenttrack.getTitle());
        creator.setText(currenttrack.getCreator());
        album.setText(currenttrack.getAlbum());
        genre.setText(currenttrack.getGenre());
        location.setText(currenttrack.getLocation());
        Button closebutton = (Button) findViewById(R.id.CloseButton);
        closebutton.setOnClickListener(new Button.OnClickListener(){
                public void onClick(View v){
                        pw.dismiss();
                }
        });





    }


// here is trackinfo.xml
<?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="wrap_content"
                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="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Close Window" />
                <Button android:id="@+id/DownloadButton"
                        android:paddingTop="15dip"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Download" />
</LinearLayout>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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