« first day (48 days earlier)
← previous day
next day →
last day (36 days later) »
Dilip Tiwari
04:37
Good Morning All
5 hours later…
King of Masses
09:40
yes
Sunisha Sindhu
paste.ofcode.org/L5KMyh7ufHKS7XeVevvNGw
this way am doing now
and in my landing page
Intent intent = new Intent(this, SyncService.class);
startService(intent);
King of Masses
ok
Sunisha Sindhu
like this way
so we dont want to start this service in any other class ya
King of Masses
have u seen that link
Sunisha Sindhu
manifest i have added
King of Masses
09:41
there clearly explained
y again confusion
Sunisha Sindhu
there itself its confusing
King of Masses
what
Sunisha Sindhu
see my doubt is is that i need to start service in each activity?
i mean this line?
Intent intent = new Intent(this, SyncService.class);
startService(intent);
King of Masses
y that is needed in every place ?
ok u can also do taht
u call APIs and load the data
on startservice onHandleIntent you store servicestarted flag in SP
and once ur IntentService result came, i mean ur API data came simply make servicestarted false
in all ur activities , check in SP if service started , dont call the service
else call the service
Sunisha Sindhu
10:00
see in my landing page what am doing before
daily once i need to take update
so am saving the date in prefernce
so if the date has been changed automatically it will take update
King of Masses
ok
then y u need that in every activity now ?.
Its heavy API call u already told
Sunisha Sindhu
see my app is default launcher
the user cant do anything else
King of Masses
it consume more data and user wont use it
Sunisha Sindhu
no i have changed it now its saving db in to fast
King of Masses
what is default launcher and user cant do anything
Sunisha Sindhu
10:02
so now if the user is in different activity
King of Masses
ok
Sunisha Sindhu
it wont update ya
so for that am using service
King of Masses
ok
Sunisha Sindhu
always our app will b open
King of Masses
then what is the problem now
tell me that
dont make me confuse
Sunisha Sindhu
10:04
see if the user is in different activity it wont update..he has to come in to landing page then only it will update
but i don't want like that way
see for example now i have landing page and stockactivity
King of Masses
ok
Sunisha Sindhu
so now am in landing page and the date has been changed it will take update
but if am in stock activity and the date is changed..but it wont update..the user has to come back to landing page
because i have done all the functionality in landing page
thats why
King of Masses
then keep it in base activity
and do there
all ur activities u extend with baseactrivity
Sunisha Sindhu
base activity means?
King of Masses
ur update code should be there in base activity
Sunisha Sindhu
10:07
landing activity?
King of Masses
no
you no about inheritence ?
quora.com/Why-create-a-BaseActivity-in-Android
read this u get
what common for all your activities those u need to write in base activity
Sunisha Sindhu
ok
King of Masses
like showToast() , showProgress() , setToolBar()
and so on
and each ur activity should extend BaseActivity instead of APPCompactActivity
ur baseActivity vll extends AppCompactActivity
Sunisha Sindhu
okay
King of Masses
read in quora link
u may get some idea
tausiq.wordpress.com/2013/01/18/…
Sunisha Sindhu
10:21
ya
done
got it
working
so no need service
@KingofMasses
King of Masses
yes
Sunisha Sindhu
Thank you...
so we can use like this way ya..then why service is using
King of Masses
if u told the issue / requirement clearly at starting it wont leads this much time
Sunisha Sindhu
is it better way?
King of Masses
service is for different usage
Sunisha Sindhu
10:23
ya true..normally this thing i thought it will use service
when app close background run
ya
King of Masses
service is for background task
ok bye
i have some work
Sunisha Sindhu
okay thank you once again
bye
King of Masses
wc
Sunisha Sindhu
@KingofMasses
playstore apk update if we give it in base activity
its okay ya
« first day (48 days earlier)
← previous day
next day →
last day (36 days later) »
all rooms
Transcript for
May
5
May '18
7
May
8
Android Doubt
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2024 Stack Exchange Inc;
legal
mobile