I am implementing a syncadapter for an android app and would like to make the settings for the account available under the "Accounts & sync" menu. I have seen this done in the DropBox app(as shown below), but I have not been able to find documentation on how to do this. I have the accounted added, just want to add a link to the account settings in this menu.
Show settings under accounts & sync menu for android app
11k views Asked by Patrick Jackson At
2
There are 2 answers
1
On
If i understood correctly, You want to show up "Accounts & sync settings" screen from within your application. For this you have to fire an intent for settings. Use code given below:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.android.providers.subscribedfeeds","com.android.settings.ManageAccountsSettings"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Hope this helped...
In your Android Manifest, you should have a section like this to define your account authenticator:
The meta-data tag above should point to an XML file that defines your account, like this:
The android:accountPreferences attribute above points to an XML file that defines your preferences screen, like so:
The above PreferenceScreen will launch an intent to display a settings screen, but you can also define the settings directly in the XML file.