Bug : Theme.Translucent & FLAG_ACTIVITY_REORDER_TO_FRONT

前端 未结 2 1369
醉梦人生
醉梦人生 2021-02-12 16:46

I have an activity with the translucent Theme :

android:theme=\"@android:style/Theme.Translucent.NoTitleBar\"

Also the problem is reproduceable

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-12 17:41

    As a workaround not an answer

    I have done this:

    public class OverlayActivity extends Activity {
    
       @Override
       protected void onNewIntent(Intent intent) {
           super.onNewIntent(intent);
           // Restart self when attempting to be brought to front
           Intent restartIntent = new Intent(this, OverlayActivity.class);
           startActivity(restartIntent);
           finish();
       }
    
       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_overlay);
       }
     }
    

    if anyone can give me an answer they win the brucey bonus!

提交回复
热议问题