Add a menu option to trigger a device search
This commit is contained in:
parent
911686f0b7
commit
0c8489683e
4 changed files with 17 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -429,4 +429,9 @@ public class ServerFragment extends ListFragment implements OnBackPressedListene
|
|||
}
|
||||
};
|
||||
|
||||
public void triggerSearch()
|
||||
{
|
||||
mUpnpService.getControlPoint().search();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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>
|
|
@ -42,6 +42,9 @@
|
|||
<!-- 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>
|
||||
|
||||
|
|
Reference in a new issue