Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

New Forums: Nexus 6 | Nexus Player | Nexus 9
test: Reply
 
LinkBack Thread Tools
Old April 18th, 2011, 09:16 AM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Feb 2011
Location: Ukraine, CK
Posts: 31
 
Device(s): Galaxy Tab 10.1 Galaxy Nexus
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via ICQ to vovs Send a message via Skype™ to vovs
Default can not find TextView in PreferenceActivity

Hi, guys. In my PreferenceActivity I have some Preferences. One I inflate from layout:

Code:
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.layout.settings);
...
}

protected void onResume() {     
        super.onResume();
Preference registrationStatus = (Preference) findPreference("registrationStatusPref");
 if (!TextUtils.isEmpty(somestring){
            registrationStatus.setLayoutResource(R.layout.push_reg_status);
            TextView push_reg_status_txt = (TextView)findViewById(R.id.pushRegTxtPref);
 }
....
}
push_reg_status_txt is TextView from push_reg_status layout, and push_reg_status always is null.

push_reg_status layout

Code:
....
<TextView
        android:id="@+id/pushRegTxtPref"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="2dp"
        android:layout_marginBottom="4dp"
        android:text="Registration Succesful"
        android:textColor="#99ff33"
        android:gravity="center_horizontal"
        android:layout_gravity="center_horizontal"/>
.....

Why?

Advertisements
vovs is offline  
Last edited by vovs; April 18th, 2011 at 09:29 AM.
Reply With Quote
sponsored links
Reply
Tags
preference, textview


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 01:58 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.