abouttreesummaryrefslogcommitdiff
path: root/srcs
diff options
context:
space:
mode:
authorjuloo2015-08-08 17:57:25 +0200
committerjuloo2015-08-08 17:58:03 +0200
commitfe432fd3ba4175bb0ae9ed2148ff5a739c5cd51a (patch)
treee57fc1ec9c5b14eb35bb09cc8e010f934f9819fd /srcs
parent153c3849903c3d8489c3af17581d3d1073abb935 (diff)
downloadunexpected-keyboard-fe432fd3ba4175bb0ae9ed2148ff5a739c5cd51a.tar.gz
unexpected-keyboard-fe432fd3ba4175bb0ae9ed2148ff5a739c5cd51a.zip
Conf key open SettingsActivity
Diffstat (limited to 'srcs')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java
index 9fb456a..2c2563a 100644
--- a/srcs/juloo.keyboard2/Keyboard2.java
+++ b/srcs/juloo.keyboard2/Keyboard2.java
@@ -1,5 +1,6 @@
package juloo.keyboard2;
+import android.content.Intent;
import android.content.SharedPreferences;
import android.inputmethodservice.InputMethodService;
import android.preference.PreferenceManager;
@@ -16,6 +17,7 @@ public class Keyboard2 extends InputMethodService
{
super.onCreate();
PreferenceManager.setDefaultValues(this, R.xml.settings, false);
+ PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
_inputView = (Keyboard2View)getLayoutInflater().inflate(R.layout.input, null);
_inputView.reset_prefs(this);
}
@@ -27,7 +29,7 @@ public class Keyboard2 extends InputMethodService
return (_inputView);
}
- public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
{
_inputView.reset_prefs(this);
}
@@ -38,7 +40,9 @@ public class Keyboard2 extends InputMethodService
return ;
if (key.getEventCode() == KeyValue.EVENT_CONFIG)
{
- // TODO: go to settings activity
+ Intent intent = new Intent(this, SettingsActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(intent);
}
else if ((flags & (KeyValue.FLAG_CTRL | KeyValue.FLAG_ALT)) != 0)
handleMetaKeyUp(key, flags);