Add a menu option to trigger a device search

This commit is contained in:
Adam Baker 2016-01-03 10:15:53 +00:00
parent 911686f0b7
commit 0c8489683e
4 changed files with 17 additions and 3 deletions

View file

@ -185,6 +185,9 @@ public class MainActivity extends ActionBarActivity {
Intent i = new Intent(this, PreferencesActivity.class);
startActivity(i);
return true;
case R.id.refreshdev:
mServerFragment.triggerSearch();
return true;
default:
return super.onOptionsItemSelected(item);
}

View file

@ -429,4 +429,9 @@ public class ServerFragment extends ListFragment implements OnBackPressedListene
}
};
public void triggerSearch()
{
mUpnpService.getControlPoint().search();
}
}

View file

@ -3,7 +3,10 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/preferences"
android:title="@string/settings_title" />
android:id="@+id/preferences"
android:title="@string/settings_title" />
<item
android:id="@+id/refreshdev"
android:title="@string/refresh_title" />
</menu>

View file

@ -41,7 +41,10 @@
<!-- Developer contact mail with '@', '.' replaced -->
<string name="contact_mail" translatable="false">controldlna%1$snutomic%2$scom</string>
<!-- Title for the Refresh Devices Action-->
<string name="refresh_title">Refresh Devices</string>
<!-- Title for the SettingsActivity -->
<string name="settings_title">Preferences</string>