|
|
|
@ -160,11 +160,15 @@ public class App extends Application {
|
|
|
|
// attachPeer adds a Peer fragment for tracking the Activity
|
|
|
|
// attachPeer adds a Peer fragment for tracking the Activity
|
|
|
|
// lifecycle.
|
|
|
|
// lifecycle.
|
|
|
|
void attachPeer(Activity act) {
|
|
|
|
void attachPeer(Activity act) {
|
|
|
|
|
|
|
|
act.runOnUiThread(new Runnable() {
|
|
|
|
|
|
|
|
@Override public void run() {
|
|
|
|
FragmentTransaction ft = act.getFragmentManager().beginTransaction();
|
|
|
|
FragmentTransaction ft = act.getFragmentManager().beginTransaction();
|
|
|
|
ft.add(new Peer(), PEER_TAG);
|
|
|
|
ft.add(new Peer(), PEER_TAG);
|
|
|
|
ft.commit();
|
|
|
|
ft.commit();
|
|
|
|
act.getFragmentManager().executePendingTransactions();
|
|
|
|
act.getFragmentManager().executePendingTransactions();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean isChromeOS() {
|
|
|
|
boolean isChromeOS() {
|
|
|
|
return getPackageManager().hasSystemFeature("android.hardware.type.pc");
|
|
|
|
return getPackageManager().hasSystemFeature("android.hardware.type.pc");
|
|
|
|
|