Fix untracked clipboard

This commit is contained in:
JeonJongHyeon97 2022-08-31 15:18:29 +09:00 committed by akallabeth
parent 6a0df205b0
commit 55015fd59b
2 changed files with 17 additions and 0 deletions

View File

@ -318,6 +318,12 @@ public class SessionActivity extends AppCompatActivity
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
@Override public void onWindowFocusChanged(boolean hasFocus)
{
super.onWindowFocusChanged(hasFocus);
mClipboardManager.getPrimaryClipManually();
}
@Override protected void onStart()
{
super.onStart();

View File

@ -24,6 +24,8 @@ public abstract class ClipboardManagerProxy
public abstract void removeClipboardboardChangedListener(OnClipboardChangedListener listener);
public abstract void getPrimaryClipManually();
public static interface OnClipboardChangedListener {
void onClipboardChanged(String data);
}
@ -47,6 +49,10 @@ public abstract class ClipboardManagerProxy
public void removeClipboardboardChangedListener(OnClipboardChangedListener listener)
{
}
@Override public void getPrimaryClipManually()
{
}
}
@TargetApi(11)
@ -96,5 +102,10 @@ public abstract class ClipboardManagerProxy
mListener = null;
mClipboardManager.removePrimaryClipChangedListener(this);
}
@Override public void getPrimaryClipManually()
{
onPrimaryClipChanged();
}
}
}