I want to develop a program which reminds word (english-turkish). The things what I have to do below and please correct me if I'm wrong or bad way I'm using.
- Create and
Main.java
class as an activity which includes a textview to show english word - Create another activity which shows Preferences to setup interval time to remind new words
- Write some code under the Save button click(inside the Prefs.java class) to save settings to
SharedPreferences
- Inflate menu inside Main activity to show Preferences Activity
- Create a service with
MyService
name. - Get interval from
SharedPreferences
inside the OnCreate method ofMyService
. - Inside the OnStart method Run a Timer according to interval and continousley connect to web service to get a new word.
- Periodically bring to front Main activity(don't want to create every time from the begining, just want to resume activity) and show new word.
- When pressed
New Word
use the service's function to connect and retrieve new word and show in TextView in Main activity - When pressed
Ok
set Activity to Pause mode and show Home Screen
I have some difficulties to Resume Main activity and passing new word.
Do you know a way to bring front Main activity periodically while it is in resume state?