开发者

android google data api for blogger crashed

开发者 https://www.devze.com 2023-01-22 20:49 出处:网络
I wanna fetch my blogger data through google data api I wrote this code: public class blogger extends Activity

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

精彩评论

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