I want to make an activity that have one spinner that spinner contain 5 colors name they are as follows,
RED,GREEN, BLUE, BLACK, WHITE.
And when I select particular color from the spinner, for example I select RED, and if I dispose that activity and again opened it then that spinner must contain the RED color name.
How can I make this type of activity? I think sharedPreferances can do it. But I'm new in Android Programming so please any one give me that kind of full activity code.
I want to do a task in android... If i enter the date of birth in a edittext then age should be calculated and if i enter the age in edittext then birth year should be calculated automatically.. This must be done without using buttons... How to do.. Help me.
This sounds like a bad UI in the making. For example, if you wanted to enter the birth year 2003 and got the 20 entered, how would your code know that it was part of the birth year and not the age? Listening for each letter typed and trying to figure out the user's intent is not always possible and leaves room for misinterpretation.
This must be done without using buttons
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
I have used the above code in my activity but nothing append anything.
Can you give me the activity? Cause I am new in Android.
What is "key, value_obtained_from_spinner"? Cause I have created the the spinner programmatically.
I have seen multiple solutions to let a Service / Activity communicate each other. However I can't understand in which context we should use them and why.
From what I've read around (android documentation and stackoverflow), these are the main approaches:
Use LocalBroadcastManager and register the Activity for receiving. Basically, the Activity listen to the broadcasts sent by the Service. Viceversa, the Service in its onStartCommand dispatch intent actions sent from the Activity (explicit intent with custom action). For dispatching actions in the service, another solution could be intent filters on the service and implicit intents (android documentation says NO in the notes, even if I declare custom actions). How many chances are that someone else uses the same custom actions as mine?
Now I'm really confused. Could somebody explain (if possible with examples) why and in which context we should use those approaches?
Are there other solutions other than the ones in this list?
modified 13-Feb-15 10:51am.
Last Visit: 21-Sep-20 6:55 Last Update: 21-Sep-20 6:55