mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-02-16 18:40:46 +00:00
Fix duplicated fragments
This commit is contained in:
@@ -49,7 +49,6 @@ import android.widget.Toast;
|
||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||
|
||||
public class PcView extends Activity implements AdapterFragmentCallbacks {
|
||||
private AdapterFragment adapterFragment;
|
||||
private RelativeLayout noPcFoundLayout;
|
||||
private PcGridAdapter pcGridAdapter;
|
||||
private ComputerManagerService.ComputerManagerBinder managerBinder;
|
||||
@@ -122,14 +121,9 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
|
||||
}
|
||||
});
|
||||
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
if (adapterFragment != null) {
|
||||
// Remove the old fragment
|
||||
transaction.remove(adapterFragment);
|
||||
}
|
||||
adapterFragment = new AdapterFragment();
|
||||
transaction.add(R.id.pcFragmentContainer, adapterFragment);
|
||||
transaction.commitAllowingStateLoss();
|
||||
getFragmentManager().beginTransaction()
|
||||
.replace(R.id.pcFragmentContainer, new AdapterFragment())
|
||||
.commitAllowingStateLoss();
|
||||
|
||||
noPcFoundLayout = (RelativeLayout) findViewById(R.id.no_pc_found_layout);
|
||||
if (pcGridAdapter.getCount() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user