From 6737cdf3650ace6ec50a67e2f6da4b0d27e5802f Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 9 Feb 2017 07:04:52 +0100 Subject: [PATCH] wear close activity when paused --- .../androidaps/actions/ActionsDefinitions.java | 2 +- .../androidaps/actions/bolus/GridActivity.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/wear/src/main/java/info/nightscout/androidaps/actions/ActionsDefinitions.java b/wear/src/main/java/info/nightscout/androidaps/actions/ActionsDefinitions.java index a1cdd49744..be134955b0 100644 --- a/wear/src/main/java/info/nightscout/androidaps/actions/ActionsDefinitions.java +++ b/wear/src/main/java/info/nightscout/androidaps/actions/ActionsDefinitions.java @@ -22,7 +22,7 @@ final class ActionsDefinitions { "Fillpreset 1", "Fillpreset 2", "Fillpreset 3", - "006"}; + "008"}; public static void doAction(int position, Context ctx) { diff --git a/wear/src/main/java/info/nightscout/androidaps/actions/bolus/GridActivity.java b/wear/src/main/java/info/nightscout/androidaps/actions/bolus/GridActivity.java index 1e50854683..230c8bc2e4 100644 --- a/wear/src/main/java/info/nightscout/androidaps/actions/bolus/GridActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/actions/bolus/GridActivity.java @@ -6,6 +6,7 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Color; import android.os.Bundle; +import android.support.wearable.activity.WearableActivity; import android.support.wearable.view.DotsPageIndicator; import android.support.wearable.view.GridPagerAdapter; import android.support.wearable.view.GridViewPager; @@ -36,8 +37,18 @@ public class GridActivity extends Activity { pager.setAdapter(new MyGridViewPagerAdapter()); DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator); dotsPageIndicator.setPager(pager); + } + + + @Override + protected void onPause() { + super.onPause(); + finish(); + } + + private class MyGridViewPagerAdapter extends GridPagerAdapter { @Override public int getColumnCount(int arg0) { @@ -67,5 +78,7 @@ public class GridActivity extends Activity { public boolean isViewFromObject(View view, Object object) { return view==object; } + + } } \ No newline at end of file