Merge "Fixing PinItemActivity not getting dismissed when starting drag-and-drop in multi-window mode" into ub-launcher3-dorval-polish
This commit is contained in:
committed by
Android (Google) Code Review
commit
ce080e8fc0
@@ -84,6 +84,8 @@ public class AddItemActivity extends BaseActivity implements OnLongClickListener
|
||||
private int mPendingBindWidgetId;
|
||||
private Bundle mWidgetOptions;
|
||||
|
||||
private boolean mFinishOnPause = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -163,6 +165,7 @@ public class AddItemActivity extends BaseActivity implements OnLongClickListener
|
||||
|
||||
startActivity(homeIntent,
|
||||
ActivityOptions.makeCustomAnimation(this, 0, android.R.anim.fade_out).toBundle());
|
||||
mFinishOnPause = true;
|
||||
|
||||
// Start a system drag and drop. We use a transparent bitmap as preview for system drag
|
||||
// as the preview is handled internally by launcher.
|
||||
@@ -182,6 +185,14 @@ public class AddItemActivity extends BaseActivity implements OnLongClickListener
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
if (mFinishOnPause) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
private void setupShortcut() {
|
||||
PinShortcutRequestActivityInfo shortcutInfo =
|
||||
new PinShortcutRequestActivityInfo(mRequest, this);
|
||||
|
||||
Reference in New Issue
Block a user