From 4c38c2cb3c658782194a95ee1e415df449b6a075 Mon Sep 17 00:00:00 2001 From: Alexandre Del Bigio Date: Fri, 4 Sep 2015 10:54:45 +0200 Subject: Activity title sync correctly with ViewPager --- app/src/main/java/org/connectbot/ConsoleActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/org/connectbot/ConsoleActivity.java b/app/src/main/java/org/connectbot/ConsoleActivity.java index ae5e3a7..04fdb73 100644 --- a/app/src/main/java/org/connectbot/ConsoleActivity.java +++ b/app/src/main/java/org/connectbot/ConsoleActivity.java @@ -47,6 +47,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; +import android.os.Trace; import android.preference.PreferenceManager; import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; @@ -500,6 +501,7 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { + setTitle(adapter.getPageTitle(position)); onTerminalChanged(); } }); @@ -1250,7 +1252,6 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne return; } bound.defaultBridge = view.bridge; - setTitle(view.bridge.host.getNickname()); } protected void updateEmptyVisible() { @@ -1368,6 +1369,8 @@ public class ConsoleActivity extends AppCompatActivity implements BridgeDisconne */ private void setDisplayedTerminal(int requestedIndex) { pager.setCurrentItem(requestedIndex); + // set activity title + setTitle(adapter.getPageTitle(requestedIndex)); onTerminalChanged(); } -- cgit v1.2.3