Monday, May 14, 2012

[android-developers] Re: Proguard and PreferenceActivity

Indeed, it is fine to call SetContentView in a PreferenceActivity, as
long as your content xml contains a ListView with id list, as the OP
example clearly does.

I use this all the time to add extra useful stuff around the standard
list of Preferences, such as Live previews of the changing settings.


On May 13, 6:46 pm, Mentos <rafal.modrzyn...@gmail.com> wrote:
> I have to add 'Save button' below preferences:
>
> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent">
>
>     <Button android:id="@+id/saveProfile"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>         android:text="@string/Save"
>         android:layout_alignParentBottom="true"
>         android:minHeight="50dp"
>         android:textColor="@drawable/button_foreground"
>         android:background="@drawable/button_background"/>
>
>     <ListView android:id="@android:id/list"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         android:layout_alignParentTop="true"
>         android:layout_above="@id/saveProfile" />
> </RelativeLayout>
>
> Its works without obsfucator.
>
> On 12 Maj, 20:09, Kostya Vasilyev <kmans...@gmail.com> wrote:
>
>
>
> > Not sure about the crash, but calling setContentView yourself on a
> > PreferenceActivity is quite meaningless.
>
> > -- K
>
> > 2012/5/12 lbendlin <l...@bendlin.us>
>
> > > The error may be caused by something else entirely.
>
> > > The other day I learned that lint in it over-eagerness gave me bad advice.
> > > It told me to put drawables into resolution folders like drawable-mdpi but
> > > it neglected to mention that this breaks the app on 1.5 devices. I had to
> > > move the drawables back to the default folder.
>
> > > On Thursday, May 10, 2012 7:35:07 AM UTC-4, Mentos wrote:
>
> > >> In my release apk I have very strange problem. In debug all works
> > >> fine.
> > >> proguard.cfg is normal from examples.
>
> > >> Any sugestion ?
>
> > >> Unable to start activity ComponentInfo{myclass}:
> > >> android.view.InflateException: Binary XML file line #2: Error
> > >> inflating class PreferenceScreen
>
> > >> public class MyClas extends PreferenceActivity implements
> > >> SharedPreferences.**OnSharedPreferenceChangeListen**er {
>
> > >>  @Override
> > >>     public void onCreate(Bundle icicle) {
> > >>         super.onCreate(icicle);
>
> > >>         addPreferencesFromResource(R.**xml.new_profile);
>
> > >>         setContentView(R.layout.new_**profile); //HERE IS PROBLEM
>
> > >>         }
> > >> ....
>
> > >  --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscribe@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en- Hide quoted text -
>
> - Show quoted text -

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate