B4A Library AHPreferenceActivity Library

andrewj

Active Member
Licensed User
Longtime User
Hi,
I'm using the AddList2 method to show a set of choices. Is there any way to show the selected choice as the subtitle on the settings screen after selection?
Thanks
Andrew
 

peacemaker

Expert
Licensed User
Longtime User
HI, no plans to add a user picture selection ?
 

andrewj

Active Member
Licensed User
Longtime User
Hi,
Is there any way to trigger an event when a user either clicks on a certain setting, or when a setting changes? I'd like to trigger some onward processing, but I'd prefer not to have to create a dummy intent with all that entails. One of Erel's posts suggested that this library provides some change events, but I can't see how this works.

Thanks
Andrew
 

corwin42

Expert
Licensed User
Longtime User

No, events are not possible.
 

itgirl

Active Member
Licensed User
Longtime User
I'm not 100% sure but i think there's a bug in the new Lib Version 1.04 in setActivity cause firs i downloaded 1.02 and it was working fine but when i downloded 1.04 it stopped working , but still One of the amazing Libs out there amazing work , thanks


P.S i didn't change anything in the code just updated the Lib and it stopped working
 

corwin42

Expert
Licensed User
Longtime User

See the changelog in first post. The package name was changed to prevent conflicts with other libraries. You have to change it in the manifest of your project, too.
 

itgirl

Active Member
Licensed User
Longtime User
See the changelog in first post. The package name was changed to prevent conflicts with other libraries. You have to change it in the manifest of your project, too.
Thanks for the reply , infact i didn't change it at firs but when i run the app it showed an exception when trying to get into the preference screen and after i saw it i changed the package name and i got into the preference without any errors except the setActivity was not working

so i should have wrote in the first post that i changed the package name lol sorry
 

corwin42

Expert
Licensed User
Longtime User

What setActivity are you talking about?
 

schimanski

Well-Known Member
Licensed User
Longtime User
Hello!!

I use the AHPreference-lib to set some passwords. But I have seen, that the dictionary saves the passwords, even though I used 'addpassword'.
I know, that it is possible to prevent this with the following code. Is it possible to combine this with the password-mode of the perference?

B4X:
PasswortFTP.InputType=Bit.OR(PasswortFTP.InputType,0x00000080)

Thanks for help...
 

schimanski

Well-Known Member
Licensed User
Longtime User
O.k, I have found a way with the SLInpTypeConst-Class:

B4X:
Dim InpTyp As SLInpTypeConst
InpTyp.Initialize
Cat_FTP.AddEditText2("PasswortFTP", "Passwort", "Passwort für FTP-Zugang eingeben", "", InpTyp.TYPE_NUMBER_VARIATION_PASSWORD, True, False, "")

Greetings....
 

SCIS

Active Member
Licensed User
Longtime User
Hey, my app crashes when I open the AHPreferenceActivity while the device is in landscape mode, is this a common problem? Is there a fix available?
 

corwin42

Expert
Licensed User
Longtime User
Hey, my app crashes when I open the AHPreferenceActivity while the device is in landscape mode, is this a common problem? Is there a fix available?

Works without problem here.

Do you have a stack trace?
 

corwin42

Expert
Licensed User
Longtime User
Probably not since I don't know what that is

The complete error message and a logcat snippet from the error.

No one can guess what "my app crashes" means.
 

SCIS

Active Member
Licensed User
Longtime User
The complete error message and a logcat snippet from the error.

No one can guess what "my app crashes" means.

No actual error message pops up on my phone, only that the app has stopped working.

http://i.gyazo.com/02ca72891bf12dac7d2934658c452aeb.png

First line is
B4X:
java.lang.RuntimeException: Unable to start activity ComponentInfo{b4a.example/de.amberhome.objects.preferenceactivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Iterator java.util.ArrayList.iterator()' on a null object reference

Also, what is the Dependency when creating views in a PreferenceScreen and what should I have there?

Sorry, these are probably all stupid questions, I'm new :/
 

corwin42

Expert
Licensed User
Longtime User

Do you have the preference activity declared in the manifest editor? You have to add

B4X:
AddApplicationText(<activity android:name="de.amberhome.objects.preferenceactivity"/>)

there.

With the dependency you can make dependent settings. So when you uncheck a checkbox setting all dependent settings will be grayed out. I think the usage is in the example. If you don't need this feature just enter an empty string as parameter.
 

SCIS

Active Member
Licensed User
Longtime User

I already have both of those. The crash only happens in landscape mode. When my phone is in portrait mode, I have no problem opening the settings screen :/
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…