Android : Android Navigate to nested fragment from other activity

on Thursday, January 29, 2015


There is MainActivity that has 3 Tab pages. Tab pages implemented as fragments. On 3rd PersonalFragment there are also tabs (but above not below).


And the third tab there is DownloadManager.


How to navigate to that nested DownloadManager from any activity?


I guess that it should be via Android Intent with some EXTRA string e.g.



intent.putExtra(EXTRA_PAGE, PAGE_DOWNLOAD_MANAGER);



@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
handleIntent(intent);
}

private void handleIntent(Intent intent) {
String place = intent.getStringExtra(EXTRA_PAGE);
if (place.equals(PAGE_DOWNLOAD_MANAGER)){
openDownloadManager();
}
}


private void openDownloadManager() {
// TODO Auto-generated method stub

}


And the n in openDownloadManager() I would call some PersonalFragment methods, then it would call nested Fragment methods ... So is it way to go?


0 comments:

Post a Comment