Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 346

Suvinay pawa
buzztouch Evangelist
Profile
Posts: 599
Reg: Aug 01, 2012
location unknow...
9,890
04/11/13 11:30 AM (12 years ago)

Refresh button android?

Is there a way to add refresh button to android? On top navigation bar maybe?
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
04/11/13 11:37 AM (12 years ago)
The code for a refresh is in a dialogue (sorry, "dialog") on every screen but only shows on the home screen, you could just move the button out of the dialog and place it wherever.
 
Suvinay pawa
buzztouch Evangelist
Profile
Posts: 599
Reg: Aug 01, 2012
location unknow...
9,890
like
04/11/13 11:47 AM (12 years ago)
Oh yeah good idea..But which java files contrains dialog code baseactivity?
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
04/11/13 12:16 PM (12 years ago)
It's in every screen activity, near the end. It shows if the screen is the home screen, and is hidden on every other screen. Haven't tried it but I guess you'd remove the if statement that only shows it on the home screen, so you could use the option on any screen.
 
Suvinay pawa
buzztouch Evangelist
Profile
Posts: 599
Reg: Aug 01, 2012
location unknow...
9,890
like
04/11/13 12:55 PM (12 years ago)
Found it thanks now testing ti.. final Button btnRefreshAppData = new Button(this); btnRefreshAppData.setText(getString(R.string.refreshAppData)); btnRefreshAppData.setOnClickListener(new OnClickListener(){ public void onClick(View v){ dialog.cancel(); refreshAppData(); } }); options.add(btnRefreshAppData); }
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.