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);
|
Intent i = new Intent(this, PreferencesActivity.class);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
return true;
|
return true;
|
||||||
|
case R.id.refreshdev:
|
||||||
|
mServerFragment.triggerSearch();
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
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">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/preferences"
|
android:id="@+id/preferences"
|
||||||
android:title="@string/settings_title" />
|
android:title="@string/settings_title" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/refreshdev"
|
||||||
|
android:title="@string/refresh_title" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
|
@ -41,7 +41,10 @@
|
||||||
|
|
||||||
<!-- Developer contact mail with '@', '.' replaced -->
|
<!-- Developer contact mail with '@', '.' replaced -->
|
||||||
<string name="contact_mail" translatable="false">controldlna%1$snutomic%2$scom</string>
|
<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 -->
|
<!-- Title for the SettingsActivity -->
|
||||||
<string name="settings_title">Preferences</string>
|
<string name="settings_title">Preferences</string>
|
||||||
|
|
||||||
|
|
Reference in a new issue