android - Xamarin: Unsure what to cast using DriveFile.Open -


i tried lookup documentation drivefile.open xamarin still can't find class cast return statement code below

var pendingresult = drivefile.open(.. , .., ..)  var obj = pendingresult.await(); 

on android documentation, class casting

drivecontents drivecontents = drivecontentsresult.getdrivecontents(); 

but can't find class called drivecontentsresult.

non-async way (using onresult callback)

drivefile.open(_googleapiclient, drivefile.modereadonly, null).setresultcallback(this); 

will call onresult , there can cast result:

void iresultcallback.onresult(java.lang.object result) {     var contentresults = (result).javacast<idriveapidrivecontentsresult>();     var drivecontent = contentresults.drivecontents;     d.writeline(drivecontent.driveid);  } 

async way:

var drivecontentresult = drivefile.openasync(_googleapiclient, drivefile.modereadonly, null).continuewith((resulttask) => {     var drivecontentresults = resulttask.result;     var drivecontent = drivecontentresults.drivecontents;     d.writeline(drivecontent.driveid); }); 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -