Skip to content
Snippets Groups Projects
Commit 7f2385b0 authored by Francesco's avatar Francesco
Browse files

bugfix

parent c6405c8e
Branches
Tags
No related merge requests found
...@@ -188,9 +188,10 @@ public class LauncherActivity extends Activity implements Reloadable { ...@@ -188,9 +188,10 @@ public class LauncherActivity extends Activity implements Reloadable {
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
if (openKeyboardOnStart) if (ui != null && openKeyboardOnStart) {
ui.onStart(); ui.onStart();
} }
}
@Override @Override
protected void onResume() { protected void onResume() {
...@@ -213,14 +214,17 @@ public class LauncherActivity extends Activity implements Reloadable { ...@@ -213,14 +214,17 @@ public class LauncherActivity extends Activity implements Reloadable {
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
if(main != null) {
main.destroy(); main.destroy();
} }
}
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (main != null) if (main != null) {
main.onBackPressed(); main.onBackPressed();
} }
}
@Override @Override
public boolean onKeyLongPress(int keyCode, KeyEvent event) { public boolean onKeyLongPress(int keyCode, KeyEvent event) {
......
...@@ -379,12 +379,18 @@ public class Tuils { ...@@ -379,12 +379,18 @@ public class Tuils {
return true; return true;
} }
public static String trimSpaces(String s) { public static CharSequence trimWhitespaces(CharSequence source) {
while (s.startsWith(SPACE))
s = s.substring(1); if(source == null)
while (s.endsWith(SPACE)) return "";
s = s.substring(0, s.length() - 1);
return s; int i = source.length();
// loop back to the first non-whitespace character
while(--i >= 0 && Character.isWhitespace(source.charAt(i))) {
}
return source.subSequence(0, i+1);
} }
public static String getSDK() { public static String getSDK() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment