1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-25 05:42:10 +01:00

Fix view intent

This commit is contained in:
vanitasvitae 2016-09-22 23:40:35 +02:00
parent 5c41c62c85
commit 2aaddec3a3

View file

@ -180,6 +180,7 @@ public class MainActivity extends AppCompatActivity
MainActivity.this.setTitle(title); MainActivity.this.setTitle(title);
} }
}); });
handleIntent(getIntent());
} }
private void setupUI(Bundle savedInstanceState) { private void setupUI(Bundle savedInstanceState) {
@ -218,10 +219,10 @@ public class MainActivity extends AppCompatActivity
} }
AppLog.v(this, "UI successfully set up"); AppLog.v(this, "UI successfully set up");
handleIntent(getIntent());
} }
public void openDiasporaUrl(String url) { public void openDiasporaUrl(String url) {
AppLog.v(this, "openDiasporaUrl()");
StreamFragment streamFragment = getStreamFragment(); StreamFragment streamFragment = getStreamFragment();
if(!streamFragment.isVisible()) { if(!streamFragment.isVisible()) {
AppLog.d(this, "StreamFragment not visible"); AppLog.d(this, "StreamFragment not visible");
@ -232,6 +233,7 @@ public class MainActivity extends AppCompatActivity
} }
public StreamFragment getStreamFragment() { public StreamFragment getStreamFragment() {
AppLog.v(this, "getStreamFragment()");
StreamFragment streamFragment = (StreamFragment) fm.findFragmentByTag(StreamFragment.TAG); StreamFragment streamFragment = (StreamFragment) fm.findFragmentByTag(StreamFragment.TAG);
if(streamFragment == null) { if(streamFragment == null) {
AppLog.d(this, "StreamFragment was null"); AppLog.d(this, "StreamFragment was null");
@ -345,6 +347,7 @@ public class MainActivity extends AppCompatActivity
return; return;
} else { } else {
loadUrl = intent.getDataString(); loadUrl = intent.getDataString();
AppLog.v(this, "Intent has a delicious URL for us: "+loadUrl);
} }
} else if (ACTION_CHANGE_ACCOUNT.equals(action)) { } else if (ACTION_CHANGE_ACCOUNT.equals(action)) {
AppLog.v(this, "Reset pod data and animate to PodSelectionActivity"); AppLog.v(this, "Reset pod data and animate to PodSelectionActivity");
@ -416,13 +419,13 @@ public class MainActivity extends AppCompatActivity
} }
CustomFragment top = (CustomFragment) getTopFragment(); CustomFragment top = (CustomFragment) getTopFragment();
if(top != null) { if(top != null) {
AppLog.d(this, "Top Fragment is not null"); AppLog.v(this, "Top Fragment is not null");
if(!top.onBackPressed()) { if(!top.onBackPressed()) {
AppLog.d(this, "Top Fragment.onBackPressed was false"); AppLog.v(this, "Top Fragment.onBackPressed was false");
//TODO: Go back in Fragment backstack snackbarExitApp.show();
return; return;
} else { } else {
AppLog.d(this, "Top Fragment.onBackPressed was true"); AppLog.v(this, "Top Fragment.onBackPressed was true");
return; return;
} }
} }