• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to resume activity - NullPointerException

 
Jeyaganeshan Jeyatharsini
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
radio_player1.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativecontainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
androidrientation="vertical" >

<ImageView
android:id="@+id/albumart_image"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:contentDescription="@string/loading_"
android:scaleType="centerCrop"
android:src="@drawable/albumart_innerbg" />

<LinearLayout
android:id="@+id/fulllinearcontainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
androidrientation="vertical" >

<LinearLayout
android:id="@+id/slidingpane"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="8"
androidrientation="vertical" >

<com.ironone.streaming.application.MySlidingPaneLayout
android:id="@+id/pane"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<FrameLayout
android:id="@+id/pane1"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<FrameLayout
android:id="@+id/pane2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true" />
</com.ironone.streaming.application.MySlidingPaneLayout>
</LinearLayout>

<LinearLayout
android:id="@+id/linear_nowplayingcontainer_"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2.2"
android:background="@color/black"
android:gravity="top|center_horizontal"
androidrientation="vertical" >

<TextView
android:id="@+id/nowPlayingInfo_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Welcome..."
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="18sp" />

<TextView
android:id="@+id/nowPlayingInfo_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="Enjoy our mobile experience!"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="18sp" />

<TextView
android:id="@+id/nowPlayingInfo_screenname"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="bottom|right"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:gravity="bottom"
android:text=" "
android:textColor="@color/gray"
android:typeface="sans" />
</LinearLayout>

<LinearLayout
android:id="@+id/orangeline"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.15"
android:background="@drawable/orangeline"
androidrientation="vertical" >
</LinearLayout>

<LinearLayout
android:id="@+id/linear_bottomcontainer"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.5"
android:background="@color/gray_dark"
android:gravity="center_vertical"
androidrientation="horizontal" >

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<ToggleButton
android:id="@+id/togglehdbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:background="@drawable/toggle_hd_button"
androidnClick="onClick_toggleHDClicked"
android:textOff=""
android:textOn="" />

<ImageView
android:id="@+id/powered_by_blue_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:contentDescription="@string/loading_"
android:src="@drawable/powered_by_blue" />

<ImageView
android:id="@+id/powered_by_gray_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:contentDescription="@string/loading_"
android:src="@drawable/powered_by_gray" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>

<ToggleButton
android:id="@+id/toggleplaybutton"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp"
android:background="@drawable/toggle_play_button"
androidnClick="onClick_togglePlayClicked"
android:textOff=""
android:textOn="" />

<ImageView
android:id="@+id/playbtn_loadingcircle"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp"
android:contentDescription="@string/loading_"
android:src="@drawable/play_btn_loading_circle" />

</RelativeLayout>


radio_player2.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativecontainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
androidrientation="vertical" >

<ImageView
android:id="@+id/albumart_image"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:contentDescription="@string/loading_"
android:scaleType="centerCrop"
android:src="@drawable/albumart_innerbg" />

<LinearLayout
android:id="@+id/fulllinearcontainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
androidrientation="vertical" >

<LinearLayout
android:id="@+id/slidingpane"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="16"
androidrientation="vertical" >

<com.ironone.streaming.application.MySlidingPaneLayout
android:id="@+id/pane"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<FrameLayout
android:id="@+id/pane1"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<FrameLayout
android:id="@+id/pane2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true" />
</com.ironone.streaming.application.MySlidingPaneLayout>
</LinearLayout>

<LinearLayout
android:id="@+id/linear_bottomcontainer"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="5"
android:background="@color/blue_theme"
android:gravity="center"
androidrientation="vertical" >

<LinearLayout
android:id="@+id/orangeline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="@drawable/orangeline"
androidrientation="vertical" >
</LinearLayout>

<LinearLayout
android:id="@+id/exceptorangeline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/blue_theme"
android:gravity="bottom"
androidrientation="horizontal" >

<RelativeLayout
android:id="@+id/play_button_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >

<ToggleButton
android:id="@+id/toggleplaybutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/toggle_play_button"
androidnClick="onClick_togglePlayClicked"
android:paddingRight="10dp"
android:textOff=""
android:textOn="" />

<ImageView
android:id="@+id/playbtn_loadingcircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:contentDescription="@string/loading_"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:src="@drawable/play_btn_loading_circle" />
</RelativeLayout>

<RelativeLayout
android:id="@+id/exceptPlayButtonAndLine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@+id/play_button_container" >

<ToggleButton
android:id="@+id/togglehdbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/linear_nowplayingcontainer_"
android:background="@drawable/toggle_hd_button"
androidnClick="onClick_toggleHDClicked"
android:paddingTop="20dp"
android:textOff=""
android:textOn="" />

<LinearLayout
android:id="@+id/linear_nowplayingcontainer_"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/powered_by_blue_icon"
android:layout_alignParentRight="true"
android:background="@color/blue_theme"
android:gravity="right"
androidrientation="horizontal"
android:padding="10dp" >

<TextView
android:id="@+id/nowPlayingInfo_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Now playing|"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="18sp" />

<TextView
android:id="@+id/nowPlayingInfo_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enjoy!"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="18sp" />
</LinearLayout>
<!-- end of now playing container -->

<TextView
android:id="@+id/nowPlayingInfo_screenname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/linear_nowplayingcontainer_"
android:text="gfdhdfh "
android:textColor="@color/white"
android:visibility="visible"
android:typeface="sans" />

<ImageView
android:id="@+id/nowPlayingInfo_screenname_underline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/nowPlayingInfo_screenname"
android:src="@drawable/loading_bar"
android:visibility="visible" />

<ImageView
android:id="@+id/powered_by_blue_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:contentDescription="@string/loading_"
android:padding="15dp"
android:src="@drawable/powered_by_blue"
android:visibility="invisible" />

<ImageView
android:id="@+id/powered_by_gray_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:contentDescription="@string/loading_"
android:padding="15dp"
android:src="@drawable/powered_by_gray"
android:visibility="invisible" />
</RelativeLayout>
<!-- end of exceptPlayButtonAndLine -->
</LinearLayout>
<!-- end of exceptorangeline -->
</LinearLayout>
<!-- end of linear_bottomcontainer -->
</LinearLayout>
<!-- end of full linear container -->

</RelativeLayout>

problem is first one is working fine. Second one not... give null pointer exception..

only the different is there is an extra image loadingbar in the second one. And it is rearranged... What might be the error? help me...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic