Skip to content

Commit

Permalink
fix press back button in cmd exit the app (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorugant authored and xyb994 committed Apr 25, 2018
1 parent 1700396 commit b9740e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/io/treehouses/remote/Dashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
public class Dashboard extends Fragment {

private static final String TAG = "BluetoothChatFragment";
private static final String BACK_STACK_ROOT_TAG = "root_fragment";


//current connection status
Expand Down Expand Up @@ -103,9 +104,11 @@ public void onClick(View view) {
@Override
public void onClick(View view) {
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.popBackStack(BACK_STACK_ROOT_TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
android.support.v4.app.FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
BluetoothChatFragment chatfrag = new BluetoothChatFragment();
fragmentTransaction.replace(R.id.sample_layout,chatfrag);
fragmentTransaction.addToBackStack(BACK_STACK_ROOT_TAG);
fragmentTransaction.commit();
}
});
Expand Down

0 comments on commit b9740e3

Please sign in to comment.