Moved Alarm Browser to fragment. Fixed bug introduced with submenu (selected item...
authorMarco Incalcaterra <jmp_3f8h@thinksoft.it>
Fri, 8 Mar 2013 22:55:27 +0000 (22:55 +0000)
committerMarco Incalcaterra <jmp_3f8h@thinksoft.it>
Fri, 8 Mar 2013 22:55:27 +0000 (22:55 +0000)
21 files changed:
.gitattributes
android/src/console/.classpath
android/src/console/AndroidManifest.xml
android/src/console/libs/acra-4.2.3.jar [deleted file]
android/src/console/libs/acra-4.4.0.jar [new file with mode: 0644]
android/src/console/res/layout/fragment_container.xml [new file with mode: 0644]
android/src/console/src/org/netxms/ui/android/NXApplication.java
android/src/console/src/org/netxms/ui/android/main/activities/AlarmBrowser.java [deleted file]
android/src/console/src/org/netxms/ui/android/main/activities/HomeScreen.java
android/src/console/src/org/netxms/ui/android/main/activities/NodeBrowser.java
android/src/console/src/org/netxms/ui/android/main/fragments/AbstractFragmentActivity.java
android/src/console/src/org/netxms/ui/android/main/fragments/AbstractListFragment.java
android/src/console/src/org/netxms/ui/android/main/fragments/AlarmBrowserFragment.java [new file with mode: 0644]
android/src/console/src/org/netxms/ui/android/main/fragments/AlarmsFragment.java
android/src/console/src/org/netxms/ui/android/main/fragments/ConsolePreferencesFragment.java
android/src/console/src/org/netxms/ui/android/main/fragments/ExpandableListFragment.java
android/src/console/src/org/netxms/ui/android/main/fragments/InterfacesFragment.java
android/src/console/src/org/netxms/ui/android/main/fragments/LastValuesFragment.java
android/src/console/src/org/netxms/ui/android/main/fragments/NodeInfoFragment.java
android/src/console/src/org/netxms/ui/android/main/fragments/OverviewFragment.java
android/src/console/src/org/netxms/ui/android/service/ClientConnectorService.java

index 6c9cde3..b016bdb 100644 (file)
@@ -59,7 +59,7 @@ android/src/console/.settings/org.eclipse.jdt.core.prefs -text
 android/src/console/AndroidManifest.xml -text
 android/src/console/default.properties -text
 android/src/console/libs/achartengine-1.0.0.jar -text
-android/src/console/libs/acra-4.2.3.jar -text svneol=unset#unset
+android/src/console/libs/acra-4.4.0.jar -text
 android/src/console/libs/simple-xml-2.6.4.jar -text
 android/src/console/lint.xml -text
 android/src/console/project.properties -text
@@ -167,6 +167,7 @@ android/src/console/res/layout/alarm_view.xml -text
 android/src/console/res/layout/alarms_fragment.xml -text
 android/src/console/res/layout/connection_point_view.xml -text
 android/src/console/res/layout/dashboard.xml -text
+android/src/console/res/layout/fragment_container.xml -text
 android/src/console/res/layout/graph_view.xml -text
 android/src/console/res/layout/graph_view_child_layout.xml -text
 android/src/console/res/layout/graph_view_group_layout.xml -text
@@ -216,7 +217,6 @@ android/src/console/src/org/netxms/ui/android/loaders/DciValueLoader.java -text
 android/src/console/src/org/netxms/ui/android/loaders/GenericObjectChildrenLoader.java -text
 android/src/console/src/org/netxms/ui/android/loaders/GenericObjectLoader.java -text
 android/src/console/src/org/netxms/ui/android/main/activities/AbstractComparisonChart.java -text
-android/src/console/src/org/netxms/ui/android/main/activities/AlarmBrowser.java -text
 android/src/console/src/org/netxms/ui/android/main/activities/ConnectionPointBrowser.java -text
 android/src/console/src/org/netxms/ui/android/main/activities/ConsolePreferences.java -text
 android/src/console/src/org/netxms/ui/android/main/activities/DashboardActivity.java -text
@@ -263,6 +263,7 @@ android/src/console/src/org/netxms/ui/android/main/dashboards/elements/TableBarC
 android/src/console/src/org/netxms/ui/android/main/dashboards/elements/TablePieChartElement.java -text
 android/src/console/src/org/netxms/ui/android/main/fragments/AbstractFragmentActivity.java -text
 android/src/console/src/org/netxms/ui/android/main/fragments/AbstractListFragment.java -text
+android/src/console/src/org/netxms/ui/android/main/fragments/AlarmBrowserFragment.java -text
 android/src/console/src/org/netxms/ui/android/main/fragments/AlarmsFragment.java -text
 android/src/console/src/org/netxms/ui/android/main/fragments/ConsolePreferencesFragment.java -text
 android/src/console/src/org/netxms/ui/android/main/fragments/ExpandableListFragment.java -text
index 08b885a..fe92121 100644 (file)
@@ -6,10 +6,10 @@
        <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
        <classpathentry exported="true" kind="lib" path="libs/simple-xml-2.6.4.jar"/>
        <classpathentry exported="true" kind="lib" path="libs/achartengine-1.0.0.jar"/>
-       <classpathentry kind="lib" path="libs/acra-4.2.3.jar"/>
        <classpathentry kind="lib" path="libs/netxms-base-1.2.6.jar"/>
        <classpathentry kind="lib" path="libs/netxms-client-1.2.6.jar"/>
        <classpathentry kind="lib" path="libs/netxms-client-api-1.2.6.jar"/>
        <classpathentry kind="lib" path="libs/android-support-v4.jar"/>
+       <classpathentry kind="lib" path="libs/acra-4.4.0.jar"/>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
index 5977cad..d3d3959 100644 (file)
@@ -8,11 +8,12 @@
     <uses-permission android:name="android.permission.VIBRATE" />
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
     <uses-permission android:name="android.permission.READ_LOGS"/>
-    <application android:icon="@drawable/icon"
-        android:allowBackup="true"
-       android:theme="@style/AppTheme"
-       android:label="@string/app_name" 
-       android:enabled="true" android:hardwareAccelerated="true" android:name="NXApplication">
+    <application android:name="NXApplication"
+                 android:icon="@drawable/icon"
+                 android:allowBackup="true"
+                android:theme="@style/AppTheme"
+                android:label="@string/app_name" 
+                android:enabled="true" android:hardwareAccelerated="true">
        <receiver android:name="org.netxms.ui.android.receivers.BootCompletedIntentReceiver">  
                        <intent-filter>  
                                <action android:name="android.intent.action.BOOT_COMPLETED" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
        </service>
-        <activity android:label="@string/app_name"
-                  android:launchMode="singleTop"
-                  android:name=".main.activities.HomeScreen">
+        <activity android:name=".main.activities.HomeScreen"
+                  android:label="@string/app_name"
+                  android:launchMode="singleTop">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity android:label="@string/app_name" 
-                  android:name=".main.activities.NodeInfo">
-        </activity>        
-        <activity android:name=".main.activities.AlarmBrowser"
+        <activity android:name=".main.activities.NodeInfo"
                   android:label="@string/app_name">
-        </activity>
+        </activity>        
         <activity android:name=".main.activities.ConsolePreferences"
                   android:label="@string/settings">
         </activity>
-        <activity android:label="@string/app_name
-                  android:name=".main.activities.NodeBrowser">
+        <activity android:name=".main.activities.NodeBrowser
+                  android:label="@string/app_name">
         </activity>
-        <activity android:label="@string/app_name" 
-                  android:name=".main.activities.GraphBrowser">
+        <activity android:name=".main.activities.GraphBrowser"
+                  android:label="@string/app_name">
         </activity>
-               <activity android:label="@string/app_name
-                  android:name=".main.activities.ConnectionPointBrowser">
+               <activity android:name=".main.activities.ConnectionPointBrowser
+                  android:label="@string/app_name">
                </activity>
-        <activity android:label="@string/app_name" 
-                  android:name=".main.activities.DrawGraph">
+        <activity android:name=".main.activities.DrawGraph"
+                  android:label="@string/app_name">
         </activity>        
-        <activity android:label="@string/app_name" 
-                  android:name=".main.activities.DrawBarChart">
+        <activity android:name=".main.activities.DrawBarChart"
+                  android:label="@string/app_name">
         </activity>        
-        <activity android:label="@string/app_name" 
-                  android:name=".main.activities.DrawPieChart">
+        <activity android:name=".main.activities.DrawPieChart"
+                  android:label="@string/app_name">
         </activity>        
-        <activity android:label="@string/app_name" 
-                  android:name=".main.activities.DashboardBrowser">
+        <activity android:name=".main.activities.DashboardBrowser"
+                  android:label="@string/app_name">
         </activity>
-        <activity android:label="@string/app_name" 
-                  android:name=".main.activities.DashboardActivity">
+        <activity android:name=".main.activities.DashboardActivity"
+                  android:label="@string/app_name">
         </activity>
-        <activity android:label="@string/app_name
-                  android:name=".main.activities.NodePollerActivity">
+        <activity android:name=".main.activities.NodePollerActivity
+                  android:label="@string/app_name">
         </activity>
-        <activity android:label="@string/app_name" 
-                  android:name=".main.activities.TableLastValues">
+        <activity android:name=".main.activities.TableLastValues"
+                  android:label="@string/app_name">
         </activity>
-        <activity android:label="@string/app_name"
-                 android:name=".main.fragments.NodeInfoFragment"
+        <activity android:name=".main.fragments.NodeInfoFragment"
+                 android:label="@string/app_name"
                  android:configChanges="orientation|screenSize">
         </activity>
-        <activity android:label="@string/settings"
-                 android:name=".main.fragments.ConsolePreferencesFragment">
+        <activity android:name=".main.fragments.ConsolePreferencesFragment"
+                 android:label="@string/settings">
+        </activity>
+        <activity android:name=".main.fragments.AlarmBrowserFragment"
+                  android:label="@string/app_name">
         </activity>
         </application>
 </manifest>
diff --git a/android/src/console/libs/acra-4.2.3.jar b/android/src/console/libs/acra-4.2.3.jar
deleted file mode 100644 (file)
index c6b57a9..0000000
Binary files a/android/src/console/libs/acra-4.2.3.jar and /dev/null differ
diff --git a/android/src/console/libs/acra-4.4.0.jar b/android/src/console/libs/acra-4.4.0.jar
new file mode 100644 (file)
index 0000000..27fdae4
Binary files /dev/null and b/android/src/console/libs/acra-4.4.0.jar differ
diff --git a/android/src/console/res/layout/fragment_container.xml b/android/src/console/res/layout/fragment_container.xml
new file mode 100644 (file)
index 0000000..3cbc434
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
+       android:id="@+id/fragment_container"\r
+       android:layout_width="match_parent"\r
+       android:layout_height="match_parent" />
\ No newline at end of file
index dca79c6..2bd7a33 100644 (file)
@@ -1,5 +1,7 @@
 package org.netxms.ui.android;
 
+import org.acra.ACRA;
+import org.acra.ErrorReporter;
 import org.acra.annotation.ReportsCrashes;
 
 import android.app.Application;
@@ -12,8 +14,8 @@ public class NXApplication extends Application
        @Override
        public void onCreate()
        {
-//             ACRA.init(this);
-//             ErrorReporter.getInstance().checkReportsOnApplicationStart();
+               ACRA.init(this);
+               ErrorReporter.getInstance().checkReportsOnApplicationStart();
                super.onCreate();
        }
 
diff --git a/android/src/console/src/org/netxms/ui/android/main/activities/AlarmBrowser.java b/android/src/console/src/org/netxms/ui/android/main/activities/AlarmBrowser.java
deleted file mode 100644 (file)
index d9a3e24..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-/**\r
- * \r
- */\r
-package org.netxms.ui.android.main.activities;\r
-\r
-import java.lang.reflect.Method;\r
-import java.util.ArrayList;\r
-\r
-import org.netxms.client.events.Alarm;\r
-import org.netxms.client.objects.GenericObject;\r
-import org.netxms.ui.android.R;\r
-import org.netxms.ui.android.main.adapters.AlarmListAdapter;\r
-import org.netxms.ui.android.main.fragments.NodeInfoFragment;\r
-\r
-import android.app.Activity;\r
-import android.content.ComponentName;\r
-import android.content.Intent;\r
-import android.content.SharedPreferences;\r
-import android.os.Bundle;\r
-import android.os.IBinder;\r
-import android.preference.PreferenceManager;\r
-import android.util.SparseBooleanArray;\r
-import android.view.ContextMenu;\r
-import android.view.ContextMenu.ContextMenuInfo;\r
-import android.view.Menu;\r
-import android.view.MenuItem;\r
-import android.view.View;\r
-import android.widget.AdapterView;\r
-import android.widget.AdapterView.AdapterContextMenuInfo;\r
-import android.widget.ListView;\r
-import android.widget.TextView;\r
-\r
-/**\r
- * Alarm browser\r
- * \r
- * @author Victor Kirhenshtein\r
- * @author Marco Incalcaterra (marco.incalcaterra@thinksoft.it)\r
- *\r
- */\r
-\r
-public class AlarmBrowser extends AbstractClientActivity\r
-{\r
-       private static final String SORT_KEY = "AlarmsSortBy";\r
-       private final int[] menuSortIds = { R.id.sort_severity_asc, R.id.sort_severity_desc,\r
-                       R.id.sort_date_asc, R.id.sort_date_desc, R.id.sort_name_asc, R.id.sort_name_desc };\r
-       private ListView listView;\r
-       private AlarmListAdapter adapter;\r
-       private ArrayList<Integer> nodeIdList;\r
-       private static Method method_invalidateOptionsMenu;\r
-\r
-       static\r
-       {\r
-               try\r
-               {\r
-                       method_invalidateOptionsMenu = Activity.class.getMethod("invalidateOptionsMenu", new Class[0]);\r
-               }\r
-               catch (NoSuchMethodException e)\r
-               {\r
-                       method_invalidateOptionsMenu = null;\r
-               }\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.netxms.ui.android.main.activities.AbstractClientActivity#onCreateStep2(android.os.Bundle)\r
-        */\r
-       @Override\r
-       protected void onCreateStep2(Bundle savedInstanceState)\r
-       {\r
-               setContentView(R.layout.alarm_view);\r
-               nodeIdList = getIntent().getIntegerArrayListExtra("nodeIdList");\r
-\r
-               TextView title = (TextView)findViewById(R.id.ScreenTitlePrimary);\r
-               title.setText(R.string.alarms_title);\r
-\r
-               // keeps current list of alarms as datasource for listview\r
-               adapter = new AlarmListAdapter(this);\r
-\r
-               listView = (ListView)findViewById(R.id.AlarmList);\r
-               listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);\r
-               listView.setAdapter(adapter);\r
-               registerForContextMenu(listView);\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see android.content.ServiceConnection#onServiceConnected(android.content.ComponentName, android.os.IBinder)\r
-        */\r
-       @Override\r
-       public void onServiceConnected(ComponentName name, IBinder binder)\r
-       {\r
-               super.onServiceConnected(name, binder);\r
-               adapter.setService(service);\r
-               service.registerAlarmBrowser(this);\r
-               refreshList();\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see android.content.ServiceConnection#onServiceDisconnected(android.content.ComponentName)\r
-        */\r
-       @Override\r
-       public void onServiceDisconnected(ComponentName name)\r
-       {\r
-               super.onServiceDisconnected(name);\r
-               adapter.setService(null);\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see android.app.Activity#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo)\r
-        */\r
-       @Override\r
-       public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo)\r
-       {\r
-               android.view.MenuInflater inflater = getMenuInflater();\r
-               inflater.inflate(R.menu.alarm_actions, menu);\r
-               checkMenuSortItem(menu);\r
-               final SparseBooleanArray positions = listView.getCheckedItemPositions();\r
-               if (positions != null)\r
-                       for (int i = 0; i < positions.size(); i++)\r
-                               if (positions.get(i))\r
-                               {\r
-                                       hideMenuItem(menu, R.id.viewlastvalues);\r
-                                       break;\r
-                               }\r
-       }\r
-\r
-       /**\r
-        * @param menu\r
-        * @param id\r
-        */\r
-       private void hideMenuItem(ContextMenu menu, int id)\r
-       {\r
-               MenuItem item = menu.findItem(id);\r
-               if (item != null)\r
-                       item.setVisible(false);\r
-       }\r
-\r
-       private void checkMenuSortItem(Menu menu)\r
-       {\r
-               int sortBy = PreferenceManager.getDefaultSharedPreferences(this).getInt(SORT_KEY, 0);\r
-               MenuItem item = menu.findItem(menuSortIds[sortBy]);\r
-               if (item != null)\r
-                       item.setChecked(true);\r
-       }\r
-\r
-       private void setNewSort(MenuItem item, int sortBy)\r
-       {\r
-               SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r
-               SharedPreferences.Editor editor = prefs.edit();\r
-               editor.putInt(SORT_KEY, sortBy);\r
-               editor.commit();\r
-               item.setChecked(!item.isChecked());\r
-               selectAll(false);\r
-               adapter.setSortBy(sortBy);\r
-               adapter.sort();\r
-               adapter.notifyDataSetChanged();\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see android.app.Activity#onCreateOptionsMenu(android.view.Menu)\r
-        */\r
-       @Override\r
-       public boolean onCreateOptionsMenu(Menu menu)\r
-       {\r
-               if (method_invalidateOptionsMenu != null)\r
-               {\r
-                       android.view.MenuInflater inflater = getMenuInflater();\r
-                       inflater.inflate(R.menu.alarm_actions, menu);\r
-               }\r
-               checkMenuSortItem(menu);\r
-               return super.onCreateOptionsMenu(menu);\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see android.app.Activity#onPrepareOptionsMenu(android.view.Menu)\r
-        */\r
-       @Override\r
-       public boolean onPrepareOptionsMenu(Menu menu)\r
-       {\r
-               super.onPrepareOptionsMenu(menu);\r
-\r
-               menu.removeItem(R.id.viewlastvalues);\r
-               if (method_invalidateOptionsMenu == null)\r
-               {\r
-                       menu.removeItem(R.id.selectall);\r
-                       menu.removeItem(R.id.unselectall);\r
-                       menu.add(Menu.NONE, R.id.selectall, Menu.NONE, getString(R.string.alarm_selectall));\r
-                       menu.add(Menu.NONE, R.id.unselectall, Menu.NONE, getString(R.string.alarm_unselectall));\r
-               }\r
-               checkMenuSortItem(menu);\r
-               return true;\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see android.app.Activity#onContextItemSelected(android.view.MenuItem)\r
-        */\r
-       @Override\r
-       public boolean onContextItemSelected(MenuItem item)\r
-       {\r
-               if (handleItemSelection(item))\r
-                       return true;\r
-               return super.onContextItemSelected(item);\r
-       }\r
-\r
-       /*\r
-        * (non-Javadoc)\r
-        * \r
-        * @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)\r
-        */\r
-       @Override\r
-       public boolean onOptionsItemSelected(MenuItem item)\r
-       {\r
-               if (handleItemSelection(item))\r
-                       return true;\r
-               return super.onOptionsItemSelected(item);\r
-       }\r
-\r
-       /**\r
-        * Handles menu item selection for both Option and Context menus\r
-        * @param item  Menu item to handle\r
-        * @return true if menu has been properly handled\r
-        */\r
-       private boolean handleItemSelection(MenuItem item)\r
-       {\r
-               switch (item.getItemId())\r
-               {\r
-                       case R.id.sort_severity_asc:\r
-                               setNewSort(item, AlarmListAdapter.SORT_SEVERITY_ASC);\r
-                               return true;\r
-                       case R.id.sort_severity_desc:\r
-                               setNewSort(item, AlarmListAdapter.SORT_SEVERITY_DESC);\r
-                               return true;\r
-                       case R.id.sort_date_asc:\r
-                               setNewSort(item, AlarmListAdapter.SORT_DATE_ASC);\r
-                               return true;\r
-                       case R.id.sort_date_desc:\r
-                               setNewSort(item, AlarmListAdapter.SORT_DATE_DESC);\r
-                               return true;\r
-                       case R.id.sort_name_asc:\r
-                               setNewSort(item, AlarmListAdapter.SORT_NAME_ASC);\r
-                               return true;\r
-                       case R.id.sort_name_desc:\r
-                               setNewSort(item, AlarmListAdapter.SORT_NAME_DESC);\r
-                               return true;\r
-                       case R.id.selectall:\r
-                               selectAll(true);\r
-                               return true;\r
-                       case R.id.unselectall:\r
-                               selectAll(false);\r
-                               return true;\r
-                       case R.id.viewlastvalues:\r
-                               if (service != null)\r
-                               {\r
-                                       AdapterView.AdapterContextMenuInfo info = (AdapterContextMenuInfo)item.getMenuInfo();\r
-                                       if (info != null)\r
-                                       {\r
-                                               Alarm al = (Alarm)adapter.getItem(info.position);\r
-                                               if (al != null)\r
-                                               {\r
-                                                       GenericObject object = service.findObjectById(al.getSourceObjectId());\r
-                                                       if (object != null)\r
-                                                       {\r
-                                                               Intent newIntent = new Intent(this, NodeInfoFragment.class);\r
-                                                               newIntent.putExtra("objectId", object.getObjectId());\r
-                                                               newIntent.putExtra("tabId", NodeInfoFragment.TAB_LAST_VALUES_ID);\r
-                                                               startActivity(newIntent);\r
-                                                       }\r
-                                               }\r
-                                       }\r
-                               }\r
-                               return true;\r
-                       case R.id.acknowledge:\r
-                               adapter.doAction(AlarmListAdapter.ACKNOWLEDGE, getSelection(item));\r
-                               return true;\r
-                       case R.id.sticky_acknowledge:\r
-                               adapter.doAction(AlarmListAdapter.STICKY_ACKNOWLEDGE, getSelection(item));\r
-                               selectAll(false);\r
-                               return true;\r
-                       case R.id.resolve:\r
-                               adapter.doAction(AlarmListAdapter.RESOLVE, getSelection(item));\r
-                               selectAll(false);\r
-                               return true;\r
-                       case R.id.terminate:\r
-                               adapter.doAction(AlarmListAdapter.TERMINATE, getSelection(item));\r
-                               selectAll(false);\r
-                               return true;\r
-               }\r
-               return false;\r
-       }\r
-\r
-       /**\r
-        * Get list of selected items\r
-        */\r
-       private ArrayList<Long> getSelection(MenuItem item)\r
-       {\r
-               ArrayList<Long> idList = new ArrayList<Long>();\r
-               final SparseBooleanArray positions = listView.getCheckedItemPositions();\r
-               if (positions != null && positions.size() > 0)\r
-                       for (int i = 0; i < adapter.getCount(); i++)\r
-                               if (positions.get(i))\r
-                               {\r
-                                       Alarm al = (Alarm)adapter.getItem(i);\r
-                                       if (al != null)\r
-                                               idList.add(al.getId());\r
-                               }\r
-               if (idList.size() == 0)\r
-               {\r
-                       AdapterView.AdapterContextMenuInfo info = (AdapterContextMenuInfo)item.getMenuInfo();\r
-                       Alarm al = (Alarm)adapter.getItem(info != null ? info.position : listView.getSelectedItemPosition());\r
-                       if (al != null)\r
-                               idList.add(al.getId());\r
-               }\r
-               return idList;\r
-       }\r
-\r
-       /**\r
-        * Select/unselect all items\r
-        * @param select true to select, false to unselect\r
-        */\r
-       private void selectAll(boolean select)\r
-       {\r
-               for (int i = 0; i < adapter.getCount(); i++)\r
-                       listView.setItemChecked(i, select);\r
-       }\r
-\r
-       /**\r
-        * Refresh alarm list\r
-        */\r
-       public void refreshList()\r
-       {\r
-               if (service != null)\r
-               {\r
-                       adapter.setFilter(nodeIdList);\r
-                       adapter.setValues(service.getAlarms());\r
-                       adapter.notifyDataSetChanged();\r
-                       final SparseBooleanArray positions = listView.getCheckedItemPositions();\r
-                       int count = positions != null ? Math.max(positions.size(), adapter.getCount()) : adapter.getCount();\r
-                       for (int i = 0; i < count; i++)\r
-                               listView.setItemChecked(i, false);\r
-               }\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see android.app.Activity#onDestroy()\r
-        */\r
-       @Override\r
-       protected void onDestroy()\r
-       {\r
-               if (service != null)\r
-                       service.registerAlarmBrowser(null);\r
-               super.onDestroy();\r
-       }\r
-}\r
index dc830e7..60add4c 100644 (file)
@@ -6,6 +6,7 @@ import org.netxms.base.NXCommon;
 import org.netxms.client.objects.GenericObject;
 import org.netxms.ui.android.R;
 import org.netxms.ui.android.main.adapters.ActivityListAdapter;
+import org.netxms.ui.android.main.fragments.AlarmBrowserFragment;
 import org.netxms.ui.android.main.fragments.NodeInfoFragment;
 import org.netxms.ui.android.service.ClientConnectorService.ConnectionStatus;
 
@@ -150,7 +151,7 @@ public class HomeScreen extends AbstractClientActivity implements OnItemClickLis
                        switch ((int)id)
                        {
                                case ACTIVITY_ALARMS:
-                                       startActivity(new Intent(this, AlarmBrowser.class));
+                                       startActivity(new Intent(this, AlarmBrowserFragment.class));
                                        break;
                                case ACTIVITY_NODES:
                                        startActivity(new Intent(this, NodeBrowser.class));
index 8479f0d..677c7c2 100644 (file)
@@ -16,6 +16,7 @@ import org.netxms.client.objecttools.ObjectTool;
 import org.netxms.ui.android.NXApplication;\r
 import org.netxms.ui.android.R;\r
 import org.netxms.ui.android.main.adapters.ObjectListAdapter;\r
+import org.netxms.ui.android.main.fragments.AlarmBrowserFragment;\r
 import org.netxms.ui.android.main.fragments.NodeInfoFragment;\r
 \r
 import android.app.AlertDialog;\r
@@ -433,7 +434,7 @@ public class NodeBrowser extends AbstractClientActivity
         */\r
        private void viewAlarms(ArrayList<Integer> nodeIdList)\r
        {\r
-               Intent newIntent = new Intent(this, AlarmBrowser.class);\r
+               Intent newIntent = new Intent(this, AlarmBrowserFragment.class);\r
                newIntent.putIntegerArrayListExtra("nodeIdList", nodeIdList);\r
                startActivity(newIntent);\r
        }\r
index 17dc71e..cbb24ac 100644 (file)
@@ -23,6 +23,9 @@ import android.view.MenuItem;
  * Abstract base class for all activities in the client. Implements\r
  * common functionality for connecting to service and handling common items\r
  * in options menu.\r
+ * \r
+ * @author Marco Incalcaterra (marco.incalcaterra@thinksoft.it)\r
+ * \r
  */\r
 public abstract class AbstractFragmentActivity extends FragmentActivity implements ServiceConnection\r
 {\r
index 3a6f327..a7ccb60 100644 (file)
@@ -1,13 +1,10 @@
 package org.netxms.ui.android.main.fragments;\r
 \r
-import java.lang.reflect.Method;\r
-\r
 import org.netxms.ui.android.R;\r
 import org.netxms.ui.android.main.activities.ConsolePreferences;\r
 import org.netxms.ui.android.main.activities.HomeScreen;\r
 import org.netxms.ui.android.service.ClientConnectorService;\r
 \r
-import android.app.Activity;\r
 import android.content.Intent;\r
 import android.os.Bundle;\r
 import android.support.v4.app.ListFragment;\r
@@ -18,7 +15,7 @@ import android.widget.ListView;
 import android.widget.TextView;\r
 \r
 /**\r
- * Abstract base class for all fragments in the client.\r
+ * Abstract base class for list fragments in the client.\r
  * Implements functionality for passing common parameters and\r
  * for handling common tasks.\r
  * \r
@@ -34,19 +31,6 @@ public abstract class AbstractListFragment extends ListFragment
        private View listContainer;\r
        private TextView standardEmptyView;\r
        protected boolean listShown;\r
-       protected static Method method_invalidateOptionsMenu;\r
-\r
-       static\r
-       {\r
-               try\r
-               {\r
-                       method_invalidateOptionsMenu = Activity.class.getMethod("invalidateOptionsMenu", new Class[0]);\r
-               }\r
-               catch (NoSuchMethodException e)\r
-               {\r
-                       method_invalidateOptionsMenu = null;\r
-               }\r
-       }\r
 \r
        @Override\r
        public void onCreate(Bundle savedInstanceState)\r
diff --git a/android/src/console/src/org/netxms/ui/android/main/fragments/AlarmBrowserFragment.java b/android/src/console/src/org/netxms/ui/android/main/fragments/AlarmBrowserFragment.java
new file mode 100644 (file)
index 0000000..4c7e88b
--- /dev/null
@@ -0,0 +1,61 @@
+/**\r
+ * \r
+ */\r
+package org.netxms.ui.android.main.fragments;\r
+\r
+import java.util.ArrayList;\r
+\r
+import org.netxms.ui.android.R;\r
+\r
+import android.content.ComponentName;\r
+import android.os.Bundle;\r
+import android.os.IBinder;\r
+import android.support.v4.app.FragmentManager;\r
+import android.support.v4.app.FragmentTransaction;\r
+\r
+/**\r
+ * Alarm browser in fragment style\r
+ * \r
+ * @author Marco Incalcaterra (marco.incalcaterra@thinksoft.it)\r
+ *\r
+ */\r
+public class AlarmBrowserFragment extends AbstractFragmentActivity\r
+{\r
+       private AlarmsFragment fragment = null;\r
+       private ArrayList<Integer> nodeIdList;\r
+\r
+       @Override\r
+       protected void onCreateStep2(Bundle savedInstanceState)\r
+       {\r
+               setContentView(R.layout.fragment_container);\r
+               nodeIdList = getIntent().getIntegerArrayListExtra("nodeIdList");\r
+               if (findViewById(R.id.fragment_container) != null)\r
+               {\r
+                       if (savedInstanceState == null)\r
+                       {\r
+                               FragmentManager fragmentManager = getSupportFragmentManager();\r
+                               FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();\r
+                               fragment = new AlarmsFragment();\r
+                               fragmentTransaction.add(R.id.fragment_container, fragment);\r
+                               fragmentTransaction.commit();\r
+                       }\r
+               }\r
+       }\r
+\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see android.content.ServiceConnection#onServiceConnected(android.content.ComponentName, android.os.IBinder)\r
+        */\r
+       @Override\r
+       public void onServiceConnected(ComponentName name, IBinder binder)\r
+       {\r
+               super.onServiceConnected(name, binder);\r
+               if (service != null && fragment != null)\r
+               {\r
+                       fragment.setNodeIdList(nodeIdList);\r
+                       fragment.setService(service);\r
+                       fragment.refresh();\r
+               }\r
+       }\r
+}\r
index 9084152..c173ac5 100644 (file)
@@ -6,10 +6,12 @@ package org.netxms.ui.android.main.fragments;
 import java.util.ArrayList;\r
 \r
 import org.netxms.client.events.Alarm;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.android.R;\r
 import org.netxms.ui.android.loaders.AlarmLoader;\r
 import org.netxms.ui.android.main.adapters.AlarmListAdapter;\r
 \r
+import android.content.Intent;\r
 import android.content.SharedPreferences;\r
 import android.os.Bundle;\r
 import android.preference.PreferenceManager;\r
@@ -25,7 +27,6 @@ import android.view.MenuItem;
 import android.view.View;\r
 import android.view.ViewGroup;\r
 import android.widget.AdapterView;\r
-import android.widget.AdapterView.AdapterContextMenuInfo;\r
 import android.widget.ListView;\r
 \r
 /**\r
@@ -40,9 +41,12 @@ public class AlarmsFragment extends AbstractListFragment implements LoaderManage
        private AlarmListAdapter adapter = null;\r
        private AlarmLoader loader = null;\r
        private ListView lv = null;\r
-       private static final String SORT_KEY = "NodeAlarmsSortBy";\r
+       private ArrayList<Integer> nodeIdList = null;\r
+       private int lastPosition = -1;\r
+       private boolean lastValuesMenuIsEnabled = true;\r
+       private static final String SORT_KEY = "AlarmsSortBy";\r
        private final int[] menuSortIds = { R.id.sort_severity_asc, R.id.sort_severity_desc,\r
-                       R.id.sort_date_asc, R.id.sort_date_desc };\r
+                       R.id.sort_date_asc, R.id.sort_date_desc, R.id.sort_name_asc, R.id.sort_name_desc };\r
 \r
        @Override\r
        public View onCreateView(LayoutInflater inflater, ViewGroup container,\r
@@ -66,15 +70,35 @@ public class AlarmsFragment extends AbstractListFragment implements LoaderManage
                        loader.setService(service);\r
                lv = getListView();\r
                registerForContextMenu(lv);\r
+               lv.setOnItemClickListener(new AdapterView.OnItemClickListener()\r
+               {\r
+                       @Override\r
+                       public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3)\r
+                       {\r
+                               lastPosition = position;\r
+                       }\r
+               });\r
+               lv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener()\r
+               {\r
+                       @Override\r
+                       public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int position, long arg3)\r
+                       {\r
+                               lastPosition = position;\r
+                               return false;\r
+                       }\r
+               });\r
        }\r
 \r
        @Override\r
        public void refresh()\r
        {\r
                if (loader != null)\r
+               {\r
                        loader.setService(service);\r
-               if (adapter != null)\r
-                       adapter.setService(service);\r
+                       if (adapter != null)\r
+                               adapter.setService(service);\r
+                       loader.forceLoad();\r
+               }\r
        }\r
 \r
        @Override\r
@@ -89,9 +113,7 @@ public class AlarmsFragment extends AbstractListFragment implements LoaderManage
                setListShown(true, true);\r
                if (adapter != null)\r
                {\r
-                       ArrayList<Integer> id = new ArrayList<Integer>(0);\r
-                       id.add((int)nodeId);\r
-                       adapter.setFilter(id);\r
+                       adapter.setFilter(nodeIdList);\r
                        adapter.setValues(arg1);\r
                        adapter.notifyDataSetChanged();\r
                }\r
@@ -107,17 +129,22 @@ public class AlarmsFragment extends AbstractListFragment implements LoaderManage
        {\r
                android.view.MenuInflater inflater = getActivity().getMenuInflater();\r
                inflater.inflate(R.menu.alarm_actions, menu);\r
-               menu.removeItem(R.id.viewlastvalues);\r
+               if (!lastValuesMenuIsEnabled)\r
+               {\r
+                       MenuItem item = menu.findItem(R.id.viewlastvalues);\r
+                       item.setVisible(false);\r
+               }\r
                checkMenuSortItem(menu);\r
        }\r
 \r
        @Override\r
        public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\r
        {\r
-               if (method_invalidateOptionsMenu != null)\r
+               inflater.inflate(R.menu.alarm_actions, menu);\r
+               if (!lastValuesMenuIsEnabled)\r
                {\r
-                       inflater.inflate(R.menu.alarm_actions, menu);\r
-                       menu.removeItem(R.id.viewlastvalues);\r
+                       MenuItem item = menu.findItem(R.id.viewlastvalues);\r
+                       item.setVisible(false);\r
                }\r
                checkMenuSortItem(menu);\r
                super.onCreateOptionsMenu(menu, inflater);\r
@@ -127,13 +154,10 @@ public class AlarmsFragment extends AbstractListFragment implements LoaderManage
        public void onPrepareOptionsMenu(Menu menu)\r
        {\r
                super.onPrepareOptionsMenu(menu);\r
-               menu.removeItem(R.id.viewlastvalues);\r
-               if (method_invalidateOptionsMenu == null)\r
+               if (!lastValuesMenuIsEnabled)\r
                {\r
-                       menu.removeItem(R.id.selectall);\r
-                       menu.removeItem(R.id.unselectall);\r
-                       menu.add(Menu.NONE, R.id.selectall, Menu.NONE, getString(R.string.alarm_selectall));\r
-                       menu.add(Menu.NONE, R.id.unselectall, Menu.NONE, getString(R.string.alarm_unselectall));\r
+                       MenuItem item = menu.findItem(R.id.viewlastvalues);\r
+                       item.setVisible(false);\r
                }\r
                checkMenuSortItem(menu);\r
        }\r
@@ -154,12 +178,36 @@ public class AlarmsFragment extends AbstractListFragment implements LoaderManage
                return super.onOptionsItemSelected(item);\r
        }\r
 \r
+       @Override\r
+       public void setNodeId(long id)\r
+       {\r
+               super.setNodeId(id);\r
+               if (nodeIdList == null)\r
+                       nodeIdList = new ArrayList<Integer>(0);\r
+               else\r
+                       nodeIdList.clear();\r
+               nodeIdList.add((int)nodeId);\r
+       }\r
+\r
+       public void setNodeIdList(ArrayList<Integer> list)\r
+       {\r
+               nodeIdList = list;\r
+       }\r
+\r
+       public void enableLastValuesMenu(boolean enable)\r
+       {\r
+               lastValuesMenuIsEnabled = enable;\r
+       }\r
+\r
        private void checkMenuSortItem(Menu menu)\r
        {\r
                int sortBy = PreferenceManager.getDefaultSharedPreferences(getActivity()).getInt(SORT_KEY, 0);\r
-               MenuItem item = menu.findItem(menuSortIds[sortBy]);\r
-               if (item != null)\r
-                       item.setChecked(true);\r
+               if (sortBy >= 0 && sortBy < menuSortIds.length)\r
+               {\r
+                       MenuItem item = menu.findItem(menuSortIds[sortBy]);\r
+                       if (item != null)\r
+                               item.setChecked(true);\r
+               }\r
        }\r
 \r
        private void setNewSort(MenuItem item, int sortBy)\r
@@ -224,6 +272,23 @@ public class AlarmsFragment extends AbstractListFragment implements LoaderManage
                                adapter.doAction(AlarmListAdapter.TERMINATE, getAlarmsSelection(item));\r
                                selectAll(false);\r
                                return true;\r
+                       case R.id.viewlastvalues:\r
+                               if (service != null)\r
+                               {\r
+                                       Alarm al = (Alarm)adapter.getItem(lastPosition);\r
+                                       if (al != null)\r
+                                       {\r
+                                               GenericObject object = service.findObjectById(al.getSourceObjectId());\r
+                                               if (object != null)\r
+                                               {\r
+                                                       Intent newIntent = new Intent(getActivity(), NodeInfoFragment.class);\r
+                                                       newIntent.putExtra("objectId", object.getObjectId());\r
+                                                       newIntent.putExtra("tabId", NodeInfoFragment.TAB_LAST_VALUES_ID);\r
+                                                       startActivity(newIntent);\r
+                                               }\r
+                                       }\r
+                               }\r
+                               return true;\r
                }\r
                return false;\r
        }\r
@@ -243,16 +308,20 @@ public class AlarmsFragment extends AbstractListFragment implements LoaderManage
                                        if (al != null)\r
                                                idList.add(al.getId());\r
                                }\r
-               if (idList.size() == 0)\r
+               if (idList.size() == 0) // Get last item highlighted\r
                {\r
-                       AdapterView.AdapterContextMenuInfo info = (AdapterContextMenuInfo)item.getMenuInfo();\r
-                       Alarm al = (Alarm)adapter.getItem(info != null ? info.position : lv.getSelectedItemPosition());\r
+                       Alarm al = (Alarm)adapter.getItem(lastPosition);\r
                        if (al != null)\r
                                idList.add(al.getId());\r
                }\r
                return idList;\r
        }\r
 \r
+       /**\r
+        * Slect/unselect all the checkboxes\r
+        * \r
+        * @param select true to select all, false to clear all \r
+        */\r
        private void selectAll(boolean select)\r
        {\r
                for (int i = 0; i < adapter.getCount(); i++)\r
index 85b1748..6c9666a 100644 (file)
@@ -7,6 +7,13 @@ import android.os.Build;
 import android.os.Bundle;\r
 import android.preference.PreferenceFragment;\r
 \r
+/**\r
+ * Fragment for preferences (API > 11)\r
+ * \r
+ * @author Marco Incalcaterra (marco.incalcaterra@thinksoft.it)\r
+ * \r
+ */\r
+\r
 @TargetApi(Build.VERSION_CODES.HONEYCOMB)\r
 public class ConsolePreferencesFragment extends PreferenceFragment\r
 {\r
index 75e0c72..5cc9319 100644 (file)
@@ -21,7 +21,8 @@ import android.widget.ListView;
  * http://stackoverflow.com/questions/6051050/expandablelistfragment-with-loadermanager-for-compatibility-package
  * and then modified and adapted to be used into the NetXMS Android console.
  *
- * @author Marco Incalcaterra
+ * @author Marco Incalcaterra (marco.incalcaterra@thinksoft.it)
+ * 
  */
 
 public class ExpandableListFragment extends AbstractListFragment
index 956d8bb..354a1c1 100644 (file)
@@ -64,6 +64,7 @@ public class InterfacesFragment extends ExpandableListFragment implements Loader
                {\r
                        loader.setObjId(nodeId);\r
                        loader.setService(service);\r
+                       loader.forceLoad();\r
                }\r
        }\r
 \r
index adbfde1..b4abcbc 100644 (file)
@@ -44,7 +44,6 @@ public class LastValuesFragment extends AbstractListFragment implements LoaderMa
        private LastValuesAdapter adapter = null;\r
        private DciValueLoader loader = null;\r
        private ListView lv = null;\r
-\r
        private static final Integer[] DEFAULT_COLORS = { 0x40699C, 0x9E413E, 0x7F9A48, 0x695185, 0x3C8DA3, 0xCC7B38, 0x4F81BD, 0xC0504D,\r
                        0x9BBB59, 0x8064A2, 0x4BACC6, 0xF79646, 0xAABAD7, 0xD9AAA9, 0xC6D6AC, 0xBAB0C9 };\r
        private static final int MAX_COLORS = DEFAULT_COLORS.length;\r
@@ -82,6 +81,7 @@ public class LastValuesFragment extends AbstractListFragment implements LoaderMa
                {\r
                        loader.setObjId(nodeId);\r
                        loader.setService(service);\r
+                       loader.forceLoad();\r
                }\r
        }\r
 \r
@@ -129,8 +129,7 @@ public class LastValuesFragment extends AbstractListFragment implements LoaderMa
        @Override\r
        public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\r
        {\r
-               if (method_invalidateOptionsMenu != null)\r
-                       inflater.inflate(R.menu.last_values_actions, menu);\r
+               inflater.inflate(R.menu.last_values_actions, menu);\r
                super.onCreateOptionsMenu(menu, inflater);\r
        }\r
 \r
@@ -138,25 +137,6 @@ public class LastValuesFragment extends AbstractListFragment implements LoaderMa
        public void onPrepareOptionsMenu(Menu menu)\r
        {\r
                super.onPrepareOptionsMenu(menu);\r
-               if (method_invalidateOptionsMenu == null)\r
-               {\r
-                       menu.removeItem(R.id.graph_half_hour);\r
-                       menu.removeItem(R.id.graph_one_hour);\r
-                       menu.removeItem(R.id.graph_two_hours);\r
-                       menu.removeItem(R.id.graph_four_hours);\r
-                       menu.removeItem(R.id.graph_one_day);\r
-                       menu.removeItem(R.id.graph_one_week);\r
-                       menu.removeItem(R.id.bar_chart);\r
-                       menu.removeItem(R.id.pie_chart);\r
-                       menu.add(Menu.NONE, R.id.graph_half_hour, Menu.NONE, getString(R.string.last_values_graph_half_hour));\r
-                       menu.add(Menu.NONE, R.id.graph_one_hour, Menu.NONE, getString(R.string.last_values_graph_one_hour));// .setIcon(R.drawable.ic_menu_line_chart);\r
-                       menu.add(Menu.NONE, R.id.graph_two_hours, Menu.NONE, getString(R.string.last_values_graph_two_hours));\r
-                       menu.add(Menu.NONE, R.id.graph_four_hours, Menu.NONE, getString(R.string.last_values_graph_four_hours));\r
-                       menu.add(Menu.NONE, R.id.graph_one_day, Menu.NONE, getString(R.string.last_values_graph_one_day));\r
-                       menu.add(Menu.NONE, R.id.graph_one_week, Menu.NONE, getString(R.string.last_values_graph_one_week));\r
-                       menu.add(Menu.NONE, R.id.bar_chart, Menu.NONE, getString(R.string.last_values_bar_chart));\r
-                       menu.add(Menu.NONE, R.id.pie_chart, Menu.NONE, getString(R.string.last_values_pie_chart));\r
-               }\r
        }\r
 \r
        @Override\r
index e0d061a..7f4ccdd 100644 (file)
@@ -67,6 +67,7 @@ public class NodeInfoFragment extends AbstractFragmentActivity
                adapter.setItem(TAB_OVERVIEW_ID, overview, getString(R.string.ni_overview), R.drawable.ni_overview_tab);
                AlarmsFragment alarms = new AlarmsFragment();
                alarms.setNodeId(nodeId);
+               alarms.enableLastValuesMenu(false);
                adapter.setItem(TAB_ALARMS_ID, alarms, getString(R.string.ni_alarms), R.drawable.ni_alarms_tab);
                LastValuesFragment lastValues = new LastValuesFragment();
                lastValues.setNodeId(nodeId);
@@ -98,6 +99,7 @@ public class NodeInfoFragment extends AbstractFragmentActivity
                                {
                                        frag.setNodeId(nodeId);
                                        frag.setService(service);
+                                       frag.refresh();
                                }
                        }
                }
index 9bcdb19..0b2d0d7 100644 (file)
@@ -58,6 +58,7 @@ public class OverviewFragment extends AbstractListFragment implements LoaderMana
                {\r
                        loader.setObjId(nodeId);\r
                        loader.setService(service);\r
+                       loader.forceLoad();\r
                }\r
        }\r
 \r
index 9b4be25..5787cc9 100644 (file)
@@ -22,11 +22,11 @@ import org.netxms.client.objecttools.ObjectTool;
 import org.netxms.ui.android.NXApplication;\r
 import org.netxms.ui.android.R;\r
 import org.netxms.ui.android.helpers.SafeParser;\r
-import org.netxms.ui.android.main.activities.AlarmBrowser;\r
 import org.netxms.ui.android.main.activities.DashboardBrowser;\r
 import org.netxms.ui.android.main.activities.GraphBrowser;\r
 import org.netxms.ui.android.main.activities.HomeScreen;\r
 import org.netxms.ui.android.main.activities.NodeBrowser;\r
+import org.netxms.ui.android.main.fragments.AlarmBrowserFragment;\r
 import org.netxms.ui.android.receivers.AlarmIntentReceiver;\r
 import org.netxms.ui.android.service.helpers.AndroidLoggingFacility;\r
 import org.netxms.ui.android.service.tasks.ConnectTask;\r
@@ -98,7 +98,6 @@ public class ClientConnectorService extends Service implements SessionListener
        private int connectionStatusColor = 0;\r
        private Map<Long, Alarm> alarms = null;\r
        private HomeScreen homeScreen = null;\r
-       private AlarmBrowser alarmBrowser = null;\r
        private NodeBrowser nodeBrowser = null;\r
        private GraphBrowser graphBrowser = null;\r
        private Alarm unknownAlarm = null;\r
@@ -257,7 +256,7 @@ public class ClientConnectorService extends Service implements SessionListener
        {\r
                if (notifyAlarm)\r
                {\r
-                       Intent notifyIntent = new Intent(getApplicationContext(), AlarmBrowser.class);\r
+                       Intent notifyIntent = new Intent(getApplicationContext(), AlarmBrowserFragment.class);\r
                        PendingIntent intent = PendingIntent.getActivity(getApplicationContext(), 0, notifyIntent, Intent.FLAG_ACTIVITY_NEW_TASK);\r
                        NotificationCompat.Builder nb = new NotificationCompat.Builder(getApplicationContext())\r
                                        .setSmallIcon(getAlarmIcon(severity))\r
@@ -769,17 +768,6 @@ public class ClientConnectorService extends Service implements SessionListener
         */\r
        private void refreshAlarmBrowser()\r
        {\r
-               if (alarmBrowser != null)\r
-               {\r
-                       alarmBrowser.runOnUiThread(new Runnable()\r
-                       {\r
-                               @Override\r
-                               public void run()\r
-                               {\r
-                                       alarmBrowser.refreshList();\r
-                               }\r
-                       });\r
-               }\r
                if (homeScreen != null)\r
                {\r
                        homeScreen.runOnUiThread(new Runnable()\r
@@ -818,6 +806,7 @@ public class ClientConnectorService extends Service implements SessionListener
                for (Loader<Set<GenericObject>> l : genericObjectChildrenLoaders)\r
                        l.forceLoad();\r
        }\r
+\r
        /**\r
         * Refresh dashboard browser activity\r
         */\r
@@ -1064,14 +1053,6 @@ public class ClientConnectorService extends Service implements SessionListener
                this.homeScreen = homeScreen;\r
        }\r
 \r
-       /**\r
-        * @param browser\r
-        */\r
-       public void registerAlarmBrowser(AlarmBrowser browser)\r
-       {\r
-               alarmBrowser = browser;\r
-       }\r
-\r
        /**\r
         * @param browser\r
         */\r