Go straight to updates tab in response to notification
This commit is contained in:
parent
e75b4b44b2
commit
905af06124
@ -64,6 +64,8 @@ public class FDroid extends TabActivity implements OnItemClickListener,
|
|||||||
private static final int REQUEST_MANAGEREPOS = 1;
|
private static final int REQUEST_MANAGEREPOS = 1;
|
||||||
private static final int REQUEST_PREFS = 2;
|
private static final int REQUEST_PREFS = 2;
|
||||||
|
|
||||||
|
public static final String EXTRA_TAB_UPDATE = "extraTab";
|
||||||
|
|
||||||
private static final int UPDATE_REPO = Menu.FIRST;
|
private static final int UPDATE_REPO = Menu.FIRST;
|
||||||
private static final int MANAGE_REPO = Menu.FIRST + 1;
|
private static final int MANAGE_REPO = Menu.FIRST + 1;
|
||||||
private static final int PREFERENCES = Menu.FIRST + 2;
|
private static final int PREFERENCES = Menu.FIRST + 2;
|
||||||
@ -126,6 +128,11 @@ public class FDroid extends TabActivity implements OnItemClickListener,
|
|||||||
Intent call = new Intent(this, ManageRepo.class);
|
Intent call = new Intent(this, ManageRepo.class);
|
||||||
call.putExtra("uri", i.getStringExtra("uri"));
|
call.putExtra("uri", i.getStringExtra("uri"));
|
||||||
startActivityForResult(call, REQUEST_MANAGEREPOS);
|
startActivityForResult(call, REQUEST_MANAGEREPOS);
|
||||||
|
} else if(i.hasExtra(EXTRA_TAB_UPDATE)) {
|
||||||
|
boolean updateTab = i.getBooleanExtra(EXTRA_TAB_UPDATE, false);
|
||||||
|
if(updateTab) {
|
||||||
|
tabHost.setCurrentTab(2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -161,6 +161,7 @@ public class UpdateService extends IntentService {
|
|||||||
CharSequence contentText = "Updates are available.";
|
CharSequence contentText = "Updates are available.";
|
||||||
Intent notificationIntent = new Intent(UpdateService.this,
|
Intent notificationIntent = new Intent(UpdateService.this,
|
||||||
FDroid.class);
|
FDroid.class);
|
||||||
|
notificationIntent.putExtra(FDroid.EXTRA_TAB_UPDATE, true);
|
||||||
PendingIntent contentIntent = PendingIntent.getActivity(
|
PendingIntent contentIntent = PendingIntent.getActivity(
|
||||||
UpdateService.this, 0, notificationIntent, 0);
|
UpdateService.this, 0, notificationIntent, 0);
|
||||||
notification.setLatestEventInfo(context, contentTitle,
|
notification.setLatestEventInfo(context, contentTitle,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user