Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android phonegap上的skydrive应用程序_Android_Cordova_Onedrive - Fatal编程技术网

Android phonegap上的skydrive应用程序

Android phonegap上的skydrive应用程序,android,cordova,onedrive,Android,Cordova,Onedrive,我们正在尝试使用phonegap访问skydrive。我们使用活动调用skydrive的登录功能。但它根本不调用登录函数 如果有人能说明这一点,那将是很大的帮助 这是代码 这里的活动是从phonegap的插件类调用的 下面的代码是被调用的活动 此处显示活动,但不显示登录页面,该页面应显示为登录功能的结果 Intent i = new Intent(myac, DispAct.class); try{ System.out.println("before s

我们正在尝试使用phonegap访问skydrive。我们使用活动调用skydrive的登录功能。但它根本不调用登录函数

如果有人能说明这一点,那将是很大的帮助

这是代码

这里的活动是从phonegap的插件类调用的

下面的代码是被调用的活动

此处显示活动,但不显示登录页面,该页面应显示为登录功能的结果

Intent i = new Intent(myac, DispAct.class);
try{
                    System.out.println("before start activity");
                     //i.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
                    // i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                ( this.cordova.getActivity()).startActivity(i);
}
catch(Exception e){  System.out.println("in catch"+e);}
package org.apache.cordova;

import java.util.Arrays;


import android.app.Activity;
import android.os.Bundle;

import com.microsoft.live.LiveAuthClient;
import com.microsoft.live.LiveAuthException;
import com.microsoft.live.LiveAuthListener;
import com.microsoft.live.LiveConnectClient;
import com.microsoft.live.LiveConnectSession;
import com.microsoft.live.LiveStatus;
import com.microsoft.live.R;

public class DispAct extends Activity
{
    log obj;

    private Object cordova;

     private static final String APP_CLIENT_ID ="00000000400D893E" ;

    @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            System.out.println("disp on create");
     }


        @Override
        protected void onStart() {
            super.onStart();
            System.out.println("disp on start");

            obj=new log();
            obj.auth = new LiveAuthClient(this.getApplicationContext(), APP_CLIENT_ID);
            Iterable<String> scopes = Arrays.asList("wl.basic","wl.signin","wl.skydrive","wl.skydrive_update");
            obj.auth.login(this,scopes,obj);//********this is the function which has to call login page but does not work
            System.out.println("disp after login");

        }

        @Override
        public void onResume()
        {

            super.onResume();
            //finish();
        }
}


final class log implements LiveAuthListener{   

    String type,message;
    LiveConnectClient client;
    LiveAuthClient auth;
    //Parcel out;

    public log()
    {
        //auth=new LiveAuthClient(this, message);
    }

    synchronized public void onAuthComplete(LiveStatus status, LiveConnectSession session, Object userState) {
        if(status == LiveStatus.CONNECTED) {
           // this.resultTextView.setText("Signed in.");
            System.out.println("IN SUCCess");
            client = new LiveConnectClient(session);
            //download(0);
            notify();

        }
        else {
            //this.resultTextView.setText("Not signed in.");
            type="ERROR";
            message="Not Connected";
            client = null;
            System.out.println("IN complete err");
            notify();
        }        
    }



    synchronized public void onAuthError(LiveAuthException exception, Object userState) {
        //this.resultTextView.setText("Error signing in: " + exception.getMessage());        
        client = null;
        //type="ERROR";
        //message="Error logging in";
        System.out.println("IN error");
        notify();
    }
}