Skip to content

Commit

Permalink
Fixed update interval?
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-yun committed Jun 29, 2018
1 parent e510bc3 commit 3a653a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);
//Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//setSupportActionBar(toolbar);


// Set swipe to refresh behavior
final MainActivity activityContext = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public View getView(int position, View convertView, ViewGroup parent) {
tag.setText("#" + parts[1]);
}

gamesWon.setText(profile.gamesWon + " games won");
if(Integer.parseInt(profile.gamesWon) > 0)
gamesWon.setText(profile.gamesWon + " games won");

level.setText("Lvl " + (Integer.parseInt(profile.Prestige)*100 + Integer.parseInt(profile.Level)));
if (!profile.Tier.equals("") && !profile.Tier.equals("nullrank")) {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/layout/OverWidgetProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a
updateInterval = profile.getUpdateInterval();
Log.d(TAG, "(" + appWidgetId + ") Update Interval: " + updateInterval);

PendingIntent pi = PendingIntent.getBroadcast(context, appWidgetId, intent, 0);
PendingIntent pi = PendingIntent.getBroadcast(context, appWidgetId, intent, PendingIntent.FLAG_UPDATE_CURRENT);
assert alarmManager != null;
alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, System.currentTimeMillis(), updateInterval, pi);

Expand Down Expand Up @@ -124,7 +124,7 @@ public void onReceive(Context context, Intent intent) {

// Normal

if (intent.getAction().equals(SYNC_CLICKED))
//if (intent.getAction().equals(SYNC_CLICKED))
WidgetUtils.setLoadingLayout(context, appWidgetId, AppWidgetManager.getInstance(context));

Intent serviceIntent = new Intent(intent);
Expand Down

0 comments on commit 3a653a1

Please sign in to comment.