Sunday, April 28, 2013

[android help] ClassCastException TextSwitcher to Adview

java - ClassCastException TextSwitcher to Adview - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















My xml layout is:



xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#C5C6E1"
android:orientation="vertical"
tools:context=".MainActivity" >

android:id="@+id/topll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId=""
ads:loadAdOnCreate="true" >


android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Drag to set font size" />

android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="100"
android:progress="25" />


android:id="@+id/ll"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

android:id="@+id/titleText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/questionTEXT"
android:textStyle="bold" />

android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/titlefav"
android:layout_below="@+id/titleText"
android:lines="15" >


android:id="@+id/titlefav"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/adView1"
android:layout_alignParentLeft="true" >

android:id="@+id/tipText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Swipe for more quotes"
android:textSize="14sp"
android:textStyle="bold" />

android:id="@+id/fav"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@drawable/f_disable" />


android:id="@+id/adView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="SMART_BANNER"
ads:adUnitId=""
ads:loadAdOnCreate="true" >






When I try to get the textswitcher as: tv = (TextSwitcher) findViewById(R.id.textView1);


I get the following exception:


android.widget.TextSwitcher cannot be cast to com.google.ads.AdView. Any ideas why this is happening?
















Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.










lang-java






.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...