aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005/dsub/activity/SubsonicActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/github/daneren2005/dsub/activity/SubsonicActivity.java')
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicActivity.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index de0809db..fca60b5e 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -23,6 +23,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Color;
@@ -89,6 +90,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
protected View primaryContainer;
protected View secondaryContainer;
protected boolean tv = false;
+ protected boolean touchscreen = true;
Spinner actionBarSpinner;
ArrayAdapter<CharSequence> spinnerAdapter;
ViewGroup rootView;
@@ -106,6 +108,10 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
tv = true;
}
+ PackageManager pm = getPackageManager();
+ if(!pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)) {
+ touchscreen = false;
+ }
setUncaughtExceptionHandler();
applyTheme();
@@ -370,8 +376,8 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
currentFragment.setContext(this);
currentFragment.onCreateOptionsMenu(menu, menuInflater);
- if(!isTv()) {
- menu.setGroupVisible(R.id.tv, false);
+ if(isTouchscreen()) {
+ menu.setGroupVisible(R.id.not_touchscreen, false);
}
} catch(Exception e) {
Log.w(TAG, "Error on creating options menu", e);
@@ -796,6 +802,9 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
public boolean isTv() {
return tv;
}
+ public boolean isTouchscreen() {
+ return touchscreen;
+ }
private void setUncaughtExceptionHandler() {
Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();