开发者

android google data api for blogger crashed

I wanna fetch my blogger data through google data api

I wrote this code:

public class blogger extends Activity 
{

    privat开发者_如何学编程e GoogleService myService;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        myService = new GoogleService("blogger", "test-blogger-0");
        try {
            myService.setUserCredentials("mitpig@gmail.com", "112233");
        } catch (AuthenticationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }  
}

but it always crashed at : myService = new GoogleService("blogger", "test-blogger-0");

and threw a 「java.lang.ExceptionInInitializerError」

could somebody tell me why ?


Well I did some research and to resolve this issue include the following jars that come with the google SDK: google-collect-1.0-rc1.jar and jsr305.jar With those jars added to the build path I can now successfully instantiate the GoogleService without the above mentioned exception.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜