Android Tutorial PreferenceActivity tutorial

noclass1980

Active Member
Licensed User
Longtime User
Version

What Android version are you on, and what is your target API level?

its 4.01 I think (no access to Tab at the mo and I'm not sure how to define the API level (what is the API?). Thanks
 

yttrium

Active Member
Licensed User
Longtime User
its 4.01 I think (no access to Tab at the mo and I'm not sure how to define the API level (what is the API?). Thanks

From my WIP tutorial (Part 1, paragraph 6) found here;


You'll notice you have the following line in your Manifest (Project > Manifest Editor).
B4X:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14"/>

Change it simply to the following in order to change the style.
B4X:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>
 
Last edited:

luke2012

Well-Known Member
Licensed User
Longtime User
There is some way to prohibit the multi-line in edittext?
For example when a user press "return" key the edit box add other lines.

It's possible to handle only one line ?
 
Last edited by a moderator:

mitsusdev

Member
Licensed User
Longtime User
Hi

if i set a parameter as

cat1.AddEditText("Field1", "Title1", "Summary1", "AAA")

and change the value from "AAA" to "BBB"

can i change the Summary data from "Summary1" to "BBB" ?

Thanks
 

mitsusdev

Member
Licensed User
Longtime User
You cannot change the Summary (without creating a new PreferenceScreen).

Ok, thx

i re-create the preference screen to resume event, but in this mode i see the new summary data only where i enter again in preference screen.

can i get the change event of preference value ?
 

mitsusdev

Member
Licensed User
Longtime User
AHPreferenceActivity library allows you to handle events.

i have tried to use AHPReferenceActivity library, but I did not understand how to get event on change parameter value

can you tell me how to do?
 

corwin42

Expert
Licensed User
Longtime User
AHPreferenceActivity library allows you to handle events.

No, that is not correct. I have thought about adding events to the libarary but it is not implemented yet.
 

gabor

New Member
Licensed User
Longtime User
Seekbars, switches,

Hi!

Will all of theese functions be supported?
Settings | Android Developers

Switches, seekbars, time dialogs, number dialogs, icons, checkbox lists, etc.
And also maybe the support of custom dialogs?

Thanks!
 

ciprian

Active Member
Licensed User
Longtime User
Hi there, i'm blocking....
I'm using AHPreferenceActivity to store an IP adress and a PORT.
I have edit1 for the IP and edit2 for the port.
I am seeing the corect values in the log, but i'm not able to write the values into an EditText on my screen.

B4X:
Main.manager.GetString("edit1")
Main.manager.GetString("edit2")
Log(Main.manager.GetAll)

EditText1.Text = "edit1"
EditText2.Text = "edit2"

What's wrong?
 

Eumel

Active Member
Licensed User
Longtime User
It should be

EditText1.Text = Main.manager.GetString("edit1")
EditText2.Text = Main.manager.GetString("edit2")
 

LA3QMA

Member
Licensed User
Longtime User
"The menu button doesn't show"

using "targetSdkVersion="11" because i'm using the GoogleMaps library.

Is there a workaround for this? Or something i can do so that older devices do not install and crash? Or is it possible to include the GoogleMaps library and only execute if android 3+ are in use?
 

boten

Active Member
Licensed User
Longtime User
Where is the preference file kept?
On activity_create I use:
Log(File.ListFiles(File.DirInternal))

but an empty array is returned.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…