How to get reference of widgetLayout

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How to get reference of widgetLayout

Postby Totoro » Thu Nov 19, 2009 4:05 pm

Hi,all

I'm trying to get a reference of widgetLayout which contained in a preference like this:
<com.android.totoro.TotoroAlarmClock.AlarmPreference
android:key="alarm"
android:id="@+id/alarmPreferenceView"
android:title="@string/alert"
android:ringtoneType="alarm"
android:showDefault="false"
android:showSilent="false"
android:widgetLayout="@xml/checkbox_widget"/>

and the checkbox_widget like this:

<?xml version="1.0" encoding="utf-8"?>
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/checkboxa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dip"
android:layout_gravity="center_vertical"
android:padding="2dip"
/>

and now comes the problem, how can i get the view of checkbox_widget in the preferenceActivity ?

I had tried findViewById , it returns null.

Many thanks !
Totoro
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Aug 17, 2009 5:03 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests