Problem in using api of AbstractAccountAuthenticator, in android.accounts

by mathcat » Thu, 19 May 2011 18:46:01 GMT

Sponsored Links
 Hi geeks!

Im new to the android.accounts apis, and now Im trying to do something
with them but a seemly dummy problem occurs...
I`ve created an Authenticator for my app but did not yet implement the
abstract methods. The icon of it successfully appears in the system
Add a Account window, and I know that when I click it, the method
addAccount in the Authenticator will be invoked.

Now I wish to do some simple thing in this method, and write codes

public Bundle addAccount(AccountAuthenticatorResponse response,
        String accountType, String authTokenType, String[]
        Bundle options) {

    String accountName = "";
    Account account = new Account(accountName, accountType);
    String password = "example_password";
    AccountManager manager = AccountManager.get(context);
    manager.addAccountExplicitly(account, password, null);

    Bundle bundle = new Bundle();
    bundle.putString(AccountManager.KEY_ACCOUNT_NAME, accountName);
    bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, accountType);
    return bundle;

Ive seen the demo of SampleSyncAdapter, and make moves like it. But I
practice using these APIs by directly adding an account. But system
crashed by the line manager.addAccountExplicitly(account, password,
null); Whats wrong with it?


Re: Problem in using api of AbstractAccountAuthenticator, in android.accounts

by umair yaya » Thu, 19 May 2011 19:37:24 GMT

 *Home Inspection <> ; *

The housing market goes up and down, but people still need
homes<> ; ,
and home inspection
professionals<> ;
play a vital role in establishing the value of property. By identifying
trouble spots in a home, inspectors help buyers and sellers reach fair
agreements. Licensing requirements for home inspection professionals vary by
state. However, most states require home
inspectors<> ;
to be bonded, to complete an industry certification, and to register with
local authorities.

Read more. <> ;


Sponsored Links

Re: Problem in using api of AbstractAccountAuthenticator, in android.accounts

by umair yaya » Thu, 19 May 2011 19:39:36 GMT



Other Threads

1. Can i fetch the latest image from gallery taken from camera ?

HI ! I want to fetch the latest image taken from camera into my code
and then can do manipulation on it. Being a newbie i dont know how to
get hold of that image .. and secondly how to read that image into my
code. I guess i have to use content providers but how?? plz guide me
with a sample code. I'll be so thankful to u ppl.


2. ListView Urgent Help Req :)

Hi guys,
I am developing a music application where there will be almost 30 to
35 lists .
Example ..
A list on page one say albums , artists  etc etc
Then if you select one list item say Albums , you go on a new page
with Album list, when u click on one album listitem , u enter song
list.. that way .
each list item has an image associated with it . And the text for the
listitem may be 2 lines per item. And the text should be scrollable.
Now my idea is to create a generic list which is common to all the
listview screens.
At runtime i should be able to pass the contents of each list to this
generic class.
What approach should i take? Can a XML layout solve this purpose..
Please give me some guidelines. Reuse is my main aim.. And for each
listitem i should be able to handle click listeners..
Please give me some guidelines.
Thanks in advance,


3. Help with UI XML

4. trouble with programmatically adding mock location data

5. launch activity like phone call

6. Running camera in emulator using computer's webcam

7. Playing video in Android not showing the video, playing sound only with a still image